Jump to content

Recommended Posts

Posted
12 hours ago, AstroSkipper said:

Now, I am able to deeply test my latest version in all its functionality. :)

... Not to jinx things or anything :P , but you better finish your tests soon ; at the rate we're going, Google :realmad: have been able to "break" youtube-dl (by serving "specially" :angry: crafted JS yt-players) every other day or two :( ...


Posted (edited)
16 hours ago, VistaLover said:

... Not to jinx things or anything :P , but you better finish your tests soon ; at the rate we're going, Google :realmad: have been able to "break" youtube-dl (by serving "specially" :angry: crafted JS yt-players) every other day or two :( ...

I am just a one-man band. ytBATCH is not only one script but an ensemble of scripts. Things take as long as they take. And as you know, haste makes waste. :P 
And Google and their damn changes can go to hell... smilie_g_002.gif

Edited by AstroSkipper
Update of content
Posted (edited)

ytBATCH for Windows XP - A fork of ytBATCH by gif_23.gifAstroSkipper

ytBATCH for Windows XP is a YouTube video and audio downloader script (or better a script ensemble) forked by @AstroSkipper from eppic's original ytBATCH script on GitHub. A lot about this project can be read in my post Pre-release of ytBATCH for Windows XP - A fork of ytBATCH by AstroSkipper. This is the first final release in version 1.5 and a big leap forward :thumbup with many changes and corrections compared to the pre-release 1.0. All changes can be found in my very long changelog. So, I'll spare you a lot of words at this point and let a few screenshots speak for themselves:

yt-Batch-for-Windows-XP-1-5-Enter-Link.p

yt-Batch-for-Windows-XP-1-5-Enter-Link-w

yt-Batch-for-Windows-XP-1-5-Preferences.

yt-Batch-for-Windows-XP-1-5-Enter-Action

yt-Batch-for-Windows-XP-1-5-Update-Cente

yt-Batch-for-Windows-XP-1-5-Help-for-yt-

ytBATCH for Windows XP - Changelog:

ytBATCH for Windows XP - Pre-release version 1.0 (aka 2.9.2):

  • wget dowloader added.
  • 7-Zip command line tool added.
  • Missing DOS command choice.exe added.
  • Non XP-compatible PowerShell commands removed. New, compatible code added.
  • @nicolaasjan's youtube-dl and yt-dlp releases implemented.
  • @Reino's latest ffmpeg release implemented.
  • Update module in terms of youtube-dl, yt-dlp and ffmpeg changed.


ytBATCH for Windows XP - Inofficial development builds 1.1 -1.4:

  • Autoupdate module for ytBATCH completely removed.
  • Update module for ytBATCH converted into a version check one.
  • Command line tools cecho, window and nircmd added.
  • Specific sizes and positions for all windows established.
  • All menus reworked and key commands coloured red.
  • Several new menu items added.
  • Several bugs fixed.


ytBATCH for Windows XP 1.5 - Final release:

  • Complete review of ytBATCH's algorithm.
  • Due to changes in pre-configurations, installer module fully reworked.
  • Some illogical or incomplete actions fixed.
  • New batch files created and added.
  • New menu items added. Beside others, links to the homepages of youtube-dl, yt-dlp, ffmpeg, ytBATCH for Windows XP and an About ytBATCH for Windows XP menu item to inform users and to give credits to the creators of programmes used.
  • Non-functional download queue restored.
  • New queue menu item added.
  • A problematic and actually unnecessary, global variable completely removed.
  • A new, global variable added.
  • The handling of the download history changed.
  • Config files for youtube-dl and yt-dlp created and assigned to each of them. The respective, desired command line options are permanently saved there. ssupercool2.gif
  • Wrong command line options for youtube-dl corrected.
  • Some important command line options have been preset by me in the new config files of youtube-dl and yt-dlp. Among other things, the video resolution is limited to a maximum of 480p. If other resolutions are required, please change this default setting in these new config files!
  • The ability to download subtitles via youtube-dl restored.
  • youtube-dl is now correctly implemented and working in ytBATCH.
  • Install and update module changed to implement @Reino's ffprobe which is needed in some cases.
  • Update module for youtube-dl and yt-dlp fully reworked. A version check created and preceded.
  • A further module for a direct update of youtube-dl, yt-dlp and ffmpeg reworked and made accessible as a menu item.
  • Help for youtube-dl respectively yt-dlp added for a quick access to all available command line options.
  • Further bugs, flaws and imperfections fixed.
  • Command line tool shortcut32 added.
  • During the initial setup, a desktop shortcut to the ytBATCH.bat start file will be automatically created.
  • Different shortcuts added to a new subfolder lnk with specific colour schemes which will be automatically adjusted during the initial setup. The user can copy the desired one to the desktop.
  • Menu item Generate ytBATCH for Windows XP shortcuts adapted to recent changes.
  • ytBATCH icon file created and added to the main folder for use in shortcuts.


ytBATCH for Windows XP 1.6:

  • Version number bumped to 1.6.
  • yt-dlp update module completely reworked. Now, a correct version check is performed first. When the update has been completed, the new version is shown once again.
  • youtube-dl update module modified accordingly.
  • Direct updater for yt-dlp and youtube-dl changed to show the new version number when the update has been completed.
  • Config files for youtube-dl and yt-dlp modified to download YouTube videos with a resolution 480p and the h264 codec at maximum combined with the audio codec mp4a for all Windows XP users on old, weak hardware like me :P, and to embed subtitles. These config files can of course be edited by the user to use higher codecs and resolutions at any time.
  • A no longer required batch file removed.


Compatibility notes:

ytBATCH for Windows XP does not have special system requirements and should run everywhere. However, it was developed under Windows XP Professional 32-Bit but should actually run under other legacy OSes like Windows Vista or Windows 7, too. I couldn't test this but the users can do it and report here. If you run Windows XP on a computer with an SSE-only CPU, however, you can only use youtube-dl as the default YouTube downloader.

Download links:

Download link for the ytBATCH for Windows XP - Pre-release version 1.0 (aka 2.9.2)
https://www.mediafire.com/file/6c9hfkfpiwextf0/ytBATCH_for_Windows_XP_2.9.2.7z/file

Download link for the final release ytBATCH for Windows XP 1.5:
https://www.mediafire.com/file/7qljpnbzsxk1yn5/ytBATCH_for_Windows_XP_1.5.7z/file

Download link for the new release ytBATCH for Windows XP 1.6:
https://www.mediafire.com/file/eukray6px9h9bg6/ytBATCH_for_Windows_XP_1.6.7z/file update.gif

ytBATCH for Windows XP is fully portable. It does not write any values to the registry and does not store any settings outside its programme folder. That means all settings are located only in its programme folder. Only a shortcut is placed on the desktop during setup. Nevertheless, the initial setup should be carried out with my original archive due to the adjustments in terms of the desired programme location that are automatically performed by the script during the initial setup and are necessary. A simple move of the programme folder after initial setup to another location would therefore make all shortcuts useless. If you do yet such a move after initial setup, you have to call the Installer.bat in the bin directory separately to re-adjust all shortcuts to the new location. The download folder for media files can be preset in the Preferences window via the menu item Change Output Path. I recommend to check all options inside this script by pressing corresponding keys to set it optimally. As far as I have noticed, all is working fine under Windows XP. And I have deeply tested all functions there. :P The general use of ytBATCH for Windows XP is actually self-explanatory and well documented on ytBATCH's homepage: https://github.com/eppic/ytBATCH. Of course, some features are only available in my fork. :) Any opinions, questions or experiences on my release ytBATCH for Windows XP are of course welcome here in my thread. If you encounter any issues with my fork, please post it only here and not on GitHub! This fork is unofficial and not supported on GitHub.

Greetings from Germany, AstroSkipper matrix.gif


P.S. from 04.04.2025: Please redownload the final release ytBATCH for Windows XP 1.5 if you have already downloaded it! I forgot to adapt one menu item to a very recent change. :whistle:

Edited by AstroSkipper
Update of content
Posted (edited)

I don't know if it has already been noticed, VLC Media Player 3.0.20 has not been able to play YouTube video links under Windows XP for months. Due to YouTube's permanent changes, the youtube.luac file from 08.06.2024 is outdated. An updated youtube.luac or youtube.lua version has not yet been published. So, I did a research and found an alternative version of the youtube.lua which makes use of the downloader yt-dlp. The Lua script project is called yt-dlp4vlc and was developed by FalloNero. Here is a link to his GitHub page: https://github.com/FalloNero/yt-dlp4vlc. I have already tested this Lua script, and it works fine. :thumbup The script calls up yt-dlp.exe and transfers the parsed link to VLC. Unfortunately, there is one small drawback. The Lua programming language does not have a command to minimise or to hide a console window. Under Windows, a console window is opened and only closed when the parsed link has been successfully transferred to VLC. I don't like that, so I modified the Lua code in this script.
This is the code of the original Lua script:

-- YouTube Link Resolver for VLC with Separate Video and Audio URLs
-- Place this script in VLC's lua/playlist directory

function probe()
    -- Check if the input is a YouTube link
    return vlc.access == "http" or vlc.access == "https" and 
           (string.match(vlc.path, "youtube%.com") or string.match(vlc.path, "youtu%.be"))
end

function parse()
    -- Construct the full YouTube URL
    local youtube_url = vlc.access .. "://" .. vlc.path

    -- Path to yt-dlp executable (modify as needed)
    local yt_dlp_path = "C:\\YT-DLP\\yt-dlp.exe"

    -- Construct the command to get the direct video and audio URLs
    local cmd = string.format(
        '%s -g "%s"',
        yt_dlp_path,
        youtube_url
    )

    -- Execute yt-dlp to get the direct video and audio URLs
    local handle = io.popen(cmd)
    
    -- Read video URL (first line)
    local video_url = handle:read("*l")
    
    -- Read audio URL (second line)
    local audio_url = handle:read("*l")
    
    handle:close()

    -- Trim any whitespace
    video_url = video_url and video_url:gsub("^%s+", ""):gsub("%s+$", "") or ""
    audio_url = audio_url and audio_url:gsub("^%s+", ""):gsub("%s+$", "") or ""

    -- Log the resolved URLs
    vlc.msg.info("[YouTube Resolver] Original URL: " .. youtube_url)
    vlc.msg.info("[YouTube Resolver] Video URL: " .. video_url)

    if audio_url and audio_url ~= "" then
        vlc.msg.info("[YouTube Resolver] Audio URL: " .. audio_url)
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video)",
                options = {
                    -- Add audio URL as input option
                    ":input-slave=" .. audio_url
                }
            }
        }
    else
        vlc.msg.warn("[YouTube Resolver] No separate audio URL found. Playing single URL with both video and audio.")
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video + Audio)"
            }
        }
    end
end

And here is the code of the Lua script modified by me::

-- YouTube Link Resolver for VLC with Separate Video and Audio URLs
-- Place this script in VLC's lua/playlist directory

function probe()
    -- Check if the input is a YouTube link
    return vlc.access == "http" or vlc.access == "https" and 
           (string.match(vlc.path, "youtube%.com") or string.match(vlc.path, "youtu%.be"))
end

function parse()
    -- Construct the full YouTube URL
    local youtube_url = vlc.access .. "://" .. vlc.path

    -- Path to yt-dlp executable (modify as needed)
    local yt_dlp_path = "c:\\Programme\\VideoLAN\\VLC\\yt-dlp.exe"

    -- Hide window and ... (modify as needed)
    local cmd_hide = 'c:\\Programme\\VideoLAN\\VLC\\nircmd.exe win hide stitle "Lua" &'

    -- Start cmd, title the window and ...
    local cmd_title = 'cmd /c title Lua &'

    -- Construct the command to get the direct video and audio URLs
    local cmd = string.format(
        '%s %s %s -g "%s"',
        cmd_title,
        cmd_hide,
        yt_dlp_path,
        youtube_url
    )

    -- Execute yt-dlp to get the direct video and audio URLs
    local handle = io.popen(cmd)
    
    -- Read video URL (first line)
    local video_url = handle:read("*l")
    
    -- Read audio URL (second line)
    local audio_url = handle:read("*l")
    
    handle:close()

    -- Trim any whitespace
    video_url = video_url and video_url:gsub("^%s+", ""):gsub("%s+$", "") or ""
    audio_url = audio_url and audio_url:gsub("^%s+", ""):gsub("%s+$", "") or ""

    -- Log the resolved URLs
    vlc.msg.info("[YouTube Resolver] Original URL: " .. youtube_url)
    vlc.msg.info("[YouTube Resolver] Video URL: " .. video_url)

    if audio_url and audio_url ~= "" then
        vlc.msg.info("[YouTube Resolver] Audio URL: " .. audio_url)
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video)",
                options = {
                    -- Add audio URL as input option
                    ":input-slave=" .. audio_url
                }
            }
        }
    else
        vlc.msg.warn("[YouTube Resolver] No separate audio URL found. Playing single URL with both video and audio.")
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video + Audio)"
            }
        }
    end
end

For hiding the console window, I have used nircmd. The script has to be adapted to the location of both files yt-dlp.exe and nircmd.exe. The advantage of this script is that from now on, the interaction of YouTube and VLC no longer depends on an updated youtube.lua script which is only carried out at very irregular intervals, but on the downloader yt-dlp.exe maintained by @nicolaasjan. Long story short, VLC Media Player 3.0.20 is again able to play YouTube videos from their links. And now even without an annoying console window. :cheerleader:

Cheers, AstroSkipper matrix.gif

Edited by AstroSkipper
Update of content
Posted

 

HI

10 hours ago, AstroSkipper said:

And here is the code of the Lua script modified by me::

thank you the  Lua script  works very well...but what's strange about VLC, if you download the vlc-3.0.21-win32.7z version or the version that installs on the official videolan page and well it doesn't work on my xp sp2 :dubbio:. on the other hand,

if I take the same Nightly version from videolan, I no longer have any problems, and haven't since the start of the vlc 3.0.21 release :).

Posted (edited)
1 hour ago, IXOYE said:

 

HI

thank you the  Lua script  works very well...but what's strange about VLC, if you download the vlc-3.0.21-win32.7z version or the version that installs on the official videolan page and well it doesn't work on my xp sp2 :dubbio:. on the other hand,

if I take the same Nightly version from videolan, I no longer have any problems, and haven't since the start of the vlc 3.0.21 release :).

The official release of VLC Media Player in version 3.0.21 is not compatible with Windows XP, even not with service pack SP3. This has been well known for a long time. So, the last official XP-compatible version is 3.0.20. But so far this version runs very well under Windows XP. And with the new youtube.lua script, links to media files on YouTube work again. ssupercool2.gif

Edited by AstroSkipper
Posted

 

Hi

1 hour ago, AstroSkipper said:

The official release of VLC Media Player in version 3.0.21 is not compatible with Windows XP, even not with service pack SP3. This has been well known for a long time. So, the last official XP-compatible version is 3.0.20. But so far this version runs very well under Windows XP. And with the new youtube.lua script, links to media files on YouTube work again. ssupercool2.gif

The VLC 3.0.21 version is XP compatible provided you use the Nightly version:rolleyes:. Official version 3.0.21 does not work on XP. :no:

Posted

For me, the official releases are always decisive when assessing the compatibility of programmes. It's great that this problem has now been fixed in the nightly version. However, my statement was clear:

2 hours ago, AstroSkipper said:

The official release of VLC Media Player in version 3.0.21 is not compatible with Windows XP, even not with service pack SP3.

Nevertheless, I will give the current nightly from 09.04.2025 a try. Therefore, thanks for the hint! :)

Posted (edited)
22 hours ago, AstroSkipper said:

I don't know if it has already been noticed, VLC Media Player 3.0.20 has not been able to play YouTube video links under Windows XP for months. Due to YouTube's permanent changes, the youtube.luac file from 08.06.2024 is outdated. An updated youtube.luac or youtube.lua version has not yet been published. So, I did a research and found an alternative version of the youtube.lua which makes use of the downloader yt-dlp. The Lua script project is called yt-dlp4vlc and was developed by FalloNero. Here is a link to his GitHub page: https://github.com/FalloNero/yt-dlp4vlc. I have already tested this Lua script, and it works fine. :thumbup The script calls up yt-dlp.exe and transfers the parsed link to VLC. Unfortunately, there is one small drawback. The Lua programming language does not have a command to minimise or to hide a console window. Under Windows, a console window is opened and only closed when the parsed link has been successfully transferred to VLC. I don't like that, so I modified the Lua code in this script.
This is the code of the original Lua script:

-- YouTube Link Resolver for VLC with Separate Video and Audio URLs
-- Place this script in VLC's lua/playlist directory

function probe()
    -- Check if the input is a YouTube link
    return vlc.access == "http" or vlc.access == "https" and 
           (string.match(vlc.path, "youtube%.com") or string.match(vlc.path, "youtu%.be"))
end

function parse()
    -- Construct the full YouTube URL
    local youtube_url = vlc.access .. "://" .. vlc.path

    -- Path to yt-dlp executable (modify as needed)
    local yt_dlp_path = "C:\\YT-DLP\\yt-dlp.exe"

    -- Construct the command to get the direct video and audio URLs
    local cmd = string.format(
        '%s -g "%s"',
        yt_dlp_path,
        youtube_url
    )

    -- Execute yt-dlp to get the direct video and audio URLs
    local handle = io.popen(cmd)
    
    -- Read video URL (first line)
    local video_url = handle:read("*l")
    
    -- Read audio URL (second line)
    local audio_url = handle:read("*l")
    
    handle:close()

    -- Trim any whitespace
    video_url = video_url and video_url:gsub("^%s+", ""):gsub("%s+$", "") or ""
    audio_url = audio_url and audio_url:gsub("^%s+", ""):gsub("%s+$", "") or ""

    -- Log the resolved URLs
    vlc.msg.info("[YouTube Resolver] Original URL: " .. youtube_url)
    vlc.msg.info("[YouTube Resolver] Video URL: " .. video_url)

    if audio_url and audio_url ~= "" then
        vlc.msg.info("[YouTube Resolver] Audio URL: " .. audio_url)
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video)",
                options = {
                    -- Add audio URL as input option
                    ":input-slave=" .. audio_url
                }
            }
        }
    else
        vlc.msg.warn("[YouTube Resolver] No separate audio URL found. Playing single URL with both video and audio.")
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video + Audio)"
            }
        }
    end
end

And here is the code of the Lua script modified by me::

-- YouTube Link Resolver for VLC with Separate Video and Audio URLs
-- Place this script in VLC's lua/playlist directory

function probe()
    -- Check if the input is a YouTube link
    return vlc.access == "http" or vlc.access == "https" and 
           (string.match(vlc.path, "youtube%.com") or string.match(vlc.path, "youtu%.be"))
end

function parse()
    -- Construct the full YouTube URL
    local youtube_url = vlc.access .. "://" .. vlc.path

    -- Path to yt-dlp executable (modify as needed)
    local yt_dlp_path = "c:\\Programme\\VideoLAN\\VLC\\yt-dlp.exe"

    -- Hide window and ... (modify as needed)
    local cmd_hide = 'c:\\Programme\\VideoLAN\\VLC\\nircmd.exe win hide stitle "Lua" &'

    -- Start cmd, title the window and ...
    local cmd_title = 'cmd /c title Lua &'

    -- Construct the command to get the direct video and audio URLs
    local cmd = string.format(
        '%s %s %s -g "%s"',
        cmd_title,
        cmd_hide,
        yt_dlp_path,
        youtube_url
    )

    -- Execute yt-dlp to get the direct video and audio URLs
    local handle = io.popen(cmd)
    
    -- Read video URL (first line)
    local video_url = handle:read("*l")
    
    -- Read audio URL (second line)
    local audio_url = handle:read("*l")
    
    handle:close()

    -- Trim any whitespace
    video_url = video_url and video_url:gsub("^%s+", ""):gsub("%s+$", "") or ""
    audio_url = audio_url and audio_url:gsub("^%s+", ""):gsub("%s+$", "") or ""

    -- Log the resolved URLs
    vlc.msg.info("[YouTube Resolver] Original URL: " .. youtube_url)
    vlc.msg.info("[YouTube Resolver] Video URL: " .. video_url)

    if audio_url and audio_url ~= "" then
        vlc.msg.info("[YouTube Resolver] Audio URL: " .. audio_url)
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video)",
                options = {
                    -- Add audio URL as input option
                    ":input-slave=" .. audio_url
                }
            }
        }
    else
        vlc.msg.warn("[YouTube Resolver] No separate audio URL found. Playing single URL with both video and audio.")
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video + Audio)"
            }
        }
    end
end

For hiding the console window, I have used nircmd. The script has to be adapted to the location of both files yt-dlp.exe and nircmd.exe. The advantage of this script is that from now on, the interaction of YouTube and VLC no longer depends on an updated youtube.lua script which is only carried out at very irregular intervals, but on the downloader yt-dlp.exe maintained by @nicolaasjan. Long story short, VLC Media Player 3.0.20 is again able to play YouTube videos from their links. And now even without an annoying console window. :cheerleader:

Cheers, AstroSkipper matrix.gif

You can place the youtube.lua file containg the posted and adapted code from above to VLC's lua/playlist directory as it is. Or, you can compile your adapted script to a luac file. It's up to you. :P I personally did the latter. And be aware of possible spaces in your path! Such paths must be additionally surrounded by quotation marks. :yes:

Edited by AstroSkipper
Update of content
Posted (edited)
9 hours ago, IXOYE said:

The VLC 3.0.21 version is XP compatible provided you use the Nightly version:rolleyes:. Official version 3.0.21 does not work on XP. :no:

 

8 hours ago, AstroSkipper said:

For me, the official releases are always decisive when assessing the compatibility of programmes. It's great that this problem has now been fixed in the nightly version. However, my statement was clear:

Nevertheless, I will give the current nightly from 09.04.2025 a try. Therefore, thanks for the hint! :)

I gave the current nightly from 09.04.2025 a try. It works under Windows XP but is not stable. :no: When watching a video on YouTube and stopping the stream with the stop button, the whole player closes. Therefore, I will stay with the official release of VLC Media Player in version 3.0.20 until a new official and stable version is released.

Edit: This issue even happens when watching a local video file. :(

Edit 2: I have tested again and found the cause of this issue. The portable version of VLC is not really portable. Every installation of the VLC Media Player uses the same vlc folder under c:\Documents and Settings. The nightly messed up this folder. :thumbdown Suddenly this issue was even in my original installation. :angry: As I already said, I will stay with the official release of VLC Media Player in version 3.0.20 until a new official and stable version is released. I made a fresh installation of version 3.0.20, and all is fine now.

Edited by AstroSkipper
Update of content
Posted (edited)
4 hours ago, AstroSkipper said:

The portable version of VLC is not really portable. Every installation of the VLC Media Player uses the same vlc folder
under c:\Documents and Settings. The nightly messed up this folder.

FYI:

https://forum.videolan.org/viewtopic.php?f=14&t=141939

https://forum.videolan.org/viewtopic.php?p=460965#p460965

https://forum.videolan.org/viewtopic.php?f=14&t=160467

Quote

Download VLC 3.0.x nightly build, the ZIP or 7Zip file.
Extract it to the folder of your choice, then create a folder named "portable" (without quotes) where VLC.exe is.

The "portable" directory will be populated with below content (settings):

./vlc.exe/portable/vlc/vlc-qt-interface.ini (GUI related settings)
./vlc.exe/portable/ml.xspf (playlist)
./vlc.exe/portable/vlcrc (app related settings)

The "portabilised" (nightly) VLC instance will load its settings from said "portable" folder and won't ever touch (mess with) VLC settings extant in %APPDATA% ...

Regards.

Edited by VistaLover
Posted (edited)

 

Hi

15 hours ago, AstroSkipper said:

I gave the current nightly from 09.04.2025 a try. It works under Windows XP but is not stable. :no: When watching a video on YouTube and stopping the stream with the stop button, the whole player closes. Therefore, I will stay with the official release of VLC Media Player in version 3.0.20 until a new official and stable version is released.

Edit: This issue even happens when watching a local video file. :(

Edit 2: I have tested again and found the cause of this issue. The portable version of VLC is not really portable. Every installation of the VLC Media Player uses the same vlc folder under c:\Documents and Settings. The nightly messed up this folder. :thumbdown Suddenly this issue was even in my original installation. :angry: As I already said, I will stay with the official release of VLC Media Player in version 3.0.20 until a new official and stable version is released. I made a fresh installation of version 3.0.20, and all is fine now.

I do not understand your problem :no:, because on my computer type of Pentium 4 A 3GHz (2004) everything works very well with 2 GB of memory and a RADEON ATI 4650 in AGP with the Nightly 3.0.21 version of 9-4-2025, I have no closure of the player with the Stop button on Youtube as well with the "stream" or with a local video.  The player with your Lua script on Nightly 3.0.21 works perfectly. I unleashed VLC Nightly 3.0.21 and laptop like "Vistalover" the written in its post ... It also works if I install it. So ultimately I think there is a problem elsewhere on your machine. I remind you that I work on XP SP2.  I use the VLC 3.0.21 Nightly version since September 2024 and it always operates on Win Xpsp2 unlike the official version on the Videolan Web. I also use it to compress small video and audio flows in MP3/MP4.:rolleyes:

Edited by IXOYE
Posted
3 hours ago, IXOYE said:

So ultimately I think there is a problem elsewhere on your machine.

No. there is no problem on my machine. :no: Without creating a portable folder inside the VLC programme folder, as written by @VistaLover, the most recent nightly from 09.04.2025 messed up my vlc folder under %APPDATA%. No more, no less. I had to clean up all VLC related things. Then I made a fresh portable setup of VLC Media Player 3.0.20. All is working fine now. :yes:

Posted

For all who don't want to use nircmd.exe from Nirsoft, I created alternative code using native PowerShell:

-- YouTube Link Resolver for VLC with Separate Video and Audio URLs
-- Place this script in VLC's lua/playlist directory

function probe()
    -- Check if the input is a YouTube link
    return vlc.access == "http" or vlc.access == "https" and 
           (string.match(vlc.path, "youtube%.com") or string.match(vlc.path, "youtu%.be"))
end

function parse()
    -- Construct the full YouTube URL
    local youtube_url = vlc.access .. "://" .. vlc.path

    -- Path to yt-dlp executable (modify as needed)
    local yt_dlp_path = 'yt-dlp.exe'

    -- Start cmd hidden and ...
    local cmd_hidden = 'PowerShell.exe -windowstyle hidden cmd /c &'

    -- Construct the command to get the direct video and audio URLs
    local cmd = string.format(
        '%s %s -g "%s"',
        cmd_hidden,
        yt_dlp_path,
        youtube_url
    )

    -- Execute yt-dlp to get the direct video and audio URLs
    local handle = io.popen(cmd)
    
    -- Read video URL (first line)
    local video_url = handle:read("*l")
    
    -- Read audio URL (second line)
    local audio_url = handle:read("*l")
    
    handle:close()

    -- Trim any whitespace
    video_url = video_url and video_url:gsub("^%s+", ""):gsub("%s+$", "") or ""
    audio_url = audio_url and audio_url:gsub("^%s+", ""):gsub("%s+$", "") or ""

    -- Log the resolved URLs
    vlc.msg.info("[YouTube Resolver] Original URL: " .. youtube_url)
    vlc.msg.info("[YouTube Resolver] Video URL: " .. video_url)

    if audio_url and audio_url ~= "" then
        vlc.msg.info("[YouTube Resolver] Audio URL: " .. audio_url)
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video)",
                options = {
                    -- Add audio URL as input option
                    ":input-slave=" .. audio_url
                }
            }
        }
    else
        vlc.msg.warn("[YouTube Resolver] No separate audio URL found. Playing single URL with both video and audio.")
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video + Audio)"
            }
        }
    end
end

If directly placing the yt-dlp.exe file into the VLC main programme folder where the vlc.exe file is located, you do not need to specify the complete path of yt-dlp. The advantage is that once compiled the lua file to a luac file, you can use it in any VLC programme directory without any customization. :P

Posted (edited)

I use Windows XP on my old, beloved but weak Pentium 4 computer. I therefore prefer another approach since the PowerShell reacts very slowly on this machine:

-- YouTube Link Resolver for VLC with Separate Video and Audio URLs
-- Place this script in VLC's lua/playlist directory

function probe()
    -- Check if the input is a YouTube link
    return vlc.access == "http" or vlc.access == "https" and 
           (string.match(vlc.path, "youtube%.com") or string.match(vlc.path, "youtu%.be"))
end

function parse()
    -- Construct the full YouTube URL
    local youtube_url = vlc.access .. "://" .. vlc.path

    -- Path to yt-dlp executable (modify as needed)
    local yt_dlp_path = 'yt-dlp.exe'

    -- Start cmd hidden and ...
    local cmd_hidden = 'hidecon cmd /c &'

    -- Construct the command to get the direct video and audio URLs
    local cmd = string.format(
        '%s %s -g "%s"',
        cmd_hidden,
        yt_dlp_path,
        youtube_url
    )

    -- Execute yt-dlp to get the direct video and audio URLs
    local handle = io.popen(cmd)
    
    -- Read video URL (first line)
    local video_url = handle:read("*l")
    
    -- Read audio URL (second line)
    local audio_url = handle:read("*l")
    
    handle:close()

    -- Trim any whitespace
    video_url = video_url and video_url:gsub("^%s+", ""):gsub("%s+$", "") or ""
    audio_url = audio_url and audio_url:gsub("^%s+", ""):gsub("%s+$", "") or ""

    -- Log the resolved URLs
    vlc.msg.info("[YouTube Resolver] Original URL: " .. youtube_url)
    vlc.msg.info("[YouTube Resolver] Video URL: " .. video_url)

    if audio_url and audio_url ~= "" then
        vlc.msg.info("[YouTube Resolver] Audio URL: " .. audio_url)
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video)",
                options = {
                    -- Add audio URL as input option
                    ":input-slave=" .. audio_url
                }
            }
        }
    else
        vlc.msg.warn("[YouTube Resolver] No separate audio URL found. Playing single URL with both video and audio.")
        return {
            {
                path = video_url,
                name = vlc.path .. " (Video + Audio)"
            }
        }
    end
end

The tool I use is hidecon and is very fast. You can get it here: http://code.kliu.org/misc/hidecon/ :thumbup

Edited by AstroSkipper

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...