AstroSkipper Posted January 3 Author Posted January 3 The LUA script yt-dlp4vlc reads the video quality preset by the user in VLC's settings only once while starting the player. If this setting is changed by the user at some point, the player has of course to be restarted to take the new setting into account. 2
AstroSkipper Posted January 3 Author Posted January 3 (edited) Since the ytdlp-silent-xp.exe file for starting yt-dlp hidden provided by FalloNero is still not working, I modified the code again and cleaned up all unnecessary lines of code. From now on, my PowerShell command "PowerShell.exe -windowstyle hidden cmd /c &" will be executed in the case the hidecon.exe file doesn't exist. If, however, the hidecon.exe file is present in the main folder of VLC, my reduced hidecon command "hidecon &" will be used instead to start yt-dlp hidden. Here is my new mod of the LUA script yt-dlp4vlc: -- YouTube Link Resolver for VLC with Separate Video and Audio URLs -- Place this script in VLC's lua/playlist directory local yt_dlp_path = 'yt-dlp.exe' local yt_dlp_silent_path = 'hidecon.exe' function sleep(s) local ntime = os.time() + s repeat until os.time() > ntime end 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 -- Extract "quality" query parameter if present local quality = youtube_url:match("[&?]quality=(%d+)[pP]?") youtube_url = youtube_url:gsub("[&?]quality=%d+[pP]?", ""):gsub("[&?]$", "") -- Remove trailing ? or & -- Get the preferred resolution preset by the user in VLC local prefres = vlc.var.inherit(nil, "preferred-resolution") if prefres < 0 then prefres = 2160 -- Best quality set to 2160p to overwrite VLC's native value of -1 end local allowed_qualities = { ["240"] = true, ["360"] = true, ["480"] = true, ["720"] = true, ["1080"] = true, ["2160"] = true } -- Default quality limited to the preferred resolution taken from VLC's settings local format_string = string.format("bestvideo[height<=%i]+bestaudio", prefres) if quality and allowed_qualities[quality] then format_string = string.format("bestvideo[height<=%i]+bestaudio", quality) vlc.msg.info("Using requested quality: " .. quality .. "p") else vlc.msg.info("No valid quality specified. Defaulting to best available.") end local cmd_hidden = 'hidecon &' -- Start cmd hidden and ... -- No better codec than h264 (an important switch for older hardware). This can of course be changed by the users according to their needs. local codec_limit = '-S "codec:h264"' local video_url = '' local audio_url = '' local yt_dlp_silent_exists = io.open(yt_dlp_silent_path, "r") ~= nil if not yt_dlp_silent_exists then vlc.msg.info(yt_dlp_silent_path .. " not found. Falling back to " .. yt_dlp_path) cmd_hidden = 'PowerShell.exe -windowstyle hidden cmd /c &' -- Start cmd hidden and ... local cmd = string.format( '%s "%s" %s -f \"%s\" -g "%s"', cmd_hidden, yt_dlp_path, codec_limit, format_string, youtube_url ) local handle = io.popen(cmd) video_url = handle:read("*l") audio_url = handle:read("*l") handle:close() else vlc.msg.info(yt_dlp_silent_path .. " found. Running program") local cmd = string.format( '%s "%s" %s -f \"%s\" -g "%s"', cmd_hidden, yt_dlp_path, codec_limit, format_string, youtube_url ) local handle = io.popen(cmd) video_url = handle:read("*l") audio_url = handle:read("*l") handle:close() end video_url = video_url and video_url:gsub("^%s+", ""):gsub("%s+$", "") or "" audio_url = audio_url and audio_url:gsub("^%s+", ""):gsub("%s+$", "") or "" 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 return { { path = video_url, name = vlc.path .. " (Video)", options = { ":input-slave=" .. audio_url } } } else return { { path = video_url, name = vlc.path .. " (Video + Audio)" } } end end Cheers, AstroSkipper Edited January 3 by AstroSkipper 2
AstroSkipper Posted January 4 Author Posted January 4 (edited) On 1/3/2026 at 3:49 PM, AstroSkipper said: Since the ytdlp-silent-xp.exe file for starting yt-dlp hidden provided by FalloNero is still not working, I modified the code again and cleaned up all unnecessary lines of code. From now on, my PowerShell command "PowerShell.exe -windowstyle hidden cmd /c &" will be executed in the case the hidecon.exe file doesn't exist. If, however, the hidecon.exe file is present in the main folder of VLC, my reduced hidecon command "hidecon &" will be used instead to start yt-dlp hidden. Here is my new mod of the LUA script yt-dlp4vlc: -- YouTube Link Resolver for VLC with Separate Video and Audio URLs -- Place this script in VLC's lua/playlist directory local yt_dlp_path = 'yt-dlp.exe' local yt_dlp_silent_path = 'hidecon.exe' function sleep(s) local ntime = os.time() + s repeat until os.time() > ntime end 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 -- Extract "quality" query parameter if present local quality = youtube_url:match("[&?]quality=(%d+)[pP]?") youtube_url = youtube_url:gsub("[&?]quality=%d+[pP]?", ""):gsub("[&?]$", "") -- Remove trailing ? or & -- Get the preferred resolution preset by the user in VLC local prefres = vlc.var.inherit(nil, "preferred-resolution") if prefres < 0 then prefres = 2160 -- Best quality set to 2160p to overwrite VLC's native value of -1 end local allowed_qualities = { ["240"] = true, ["360"] = true, ["480"] = true, ["720"] = true, ["1080"] = true, ["2160"] = true } -- Default quality limited to the preferred resolution taken from VLC's settings local format_string = string.format("bestvideo[height<=%i]+bestaudio", prefres) if quality and allowed_qualities[quality] then format_string = string.format("bestvideo[height<=%i]+bestaudio", quality) vlc.msg.info("Using requested quality: " .. quality .. "p") else vlc.msg.info("No valid quality specified. Defaulting to best available.") end local cmd_hidden = 'hidecon &' -- Start cmd hidden and ... -- No better codec than h264 (an important switch for older hardware). This can of course be changed by the users according to their needs. local codec_limit = '-S "codec:h264"' local video_url = '' local audio_url = '' local yt_dlp_silent_exists = io.open(yt_dlp_silent_path, "r") ~= nil if not yt_dlp_silent_exists then vlc.msg.info(yt_dlp_silent_path .. " not found. Falling back to " .. yt_dlp_path) cmd_hidden = 'PowerShell.exe -windowstyle hidden cmd /c &' -- Start cmd hidden and ... local cmd = string.format( '%s "%s" %s -f \"%s\" -g "%s"', cmd_hidden, yt_dlp_path, codec_limit, format_string, youtube_url ) local handle = io.popen(cmd) video_url = handle:read("*l") audio_url = handle:read("*l") handle:close() else vlc.msg.info(yt_dlp_silent_path .. " found. Running program") local cmd = string.format( '%s "%s" %s -f \"%s\" -g "%s"', cmd_hidden, yt_dlp_path, codec_limit, format_string, youtube_url ) local handle = io.popen(cmd) video_url = handle:read("*l") audio_url = handle:read("*l") handle:close() end video_url = video_url and video_url:gsub("^%s+", ""):gsub("%s+$", "") or "" audio_url = audio_url and audio_url:gsub("^%s+", ""):gsub("%s+$", "") or "" 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 return { { path = video_url, name = vlc.path .. " (Video)", options = { ":input-slave=" .. audio_url } } } else return { { path = video_url, name = vlc.path .. " (Video + Audio)" } } end end Cheers, AstroSkipper For anyone who isn't familiar with LUA scripts. My mod of the LUA script yt-dlp4vlc does the following: YouTube links entered in VLC are now processed by the YouTube downloader yt-dlp and are then transferred to VLC and played back. Credits to FalloNero. The console window is hidden either by a PowerShell command or by the tool hidecon if the latter exists in VLC's programme folder. Video links without appended quality parameter can now be played again with the quality preset by the user in the VLC settings. The default video codec has been preset by me to h264 so that even older hardware is supported. This can of course be changed in the script by the users according to their needs. Edited January 4 by AstroSkipper 3
VistaLover Posted January 4 Posted January 4 On 1/3/2026 at 4:49 PM, AstroSkipper said: Since the ytdlp-silent-xp.exe file for starting yt-dlp hidden provided by FalloNero is still not working Does this refer to yesterday's latest offering ? https://github.com/FalloNero/yt-dlp4vlc/commit/93ad2eeffdcdaf2cc0a6ef685b57399d7787c789 (built with VC2005 ?) 1
AstroSkipper Posted January 4 Author Posted January 4 (edited) 56 minutes ago, VistaLover said: Does this refer to yesterday's latest offering ? https://github.com/FalloNero/yt-dlp4vlc/commit/93ad2eeffdcdaf2cc0a6ef685b57399d7787c789 (built with VC2005 ?) Yes. All builds of ytdlp-silent-xp.exe have been tested by me on my Windows XP computer. Unfortunately, none of them are working, not even the latest. Edited January 4 by AstroSkipper 3
AstroSkipper Posted January 7 Author Posted January 7 (edited) As part of my work on ytBATCH, I have investigated many ffmpeg releases that are supposed to be compatible with Windows XP. These include, for example, the releases from @Reino, sherpya and @autodidact. The relatively new ones from @Reino and @autodidact work well with YouTube. But when it comes to TV streams, it's a completely different story. Their latest ones in particular have considerable problems with TV stream URLs. On my old Windows XP computer, negative performance changes are immediately apparent. FFmpeg 3.4.1 from 2017 is too old and can no longer access TV stream addresses. The newer releases 7.1 from 2024 and 8.1 from 2025 require much more CPU power than before. They are therefore problematic for older, weak Windows XP computers. That's why I still have been using ffmpeg releases from 2019 for TV stream addresses. Edited January 7 by AstroSkipper 3
Ben Markson Posted Friday at 07:27 PM Posted Friday at 07:27 PM For anyone struggling to navigate their way through this long thread and who just want some basic instructions getting the yt-dlp4vlc thing to work... This is with VLC 3.0.23.0 Firstly, I had to install the yt-dlp4vlc script in C:\Program Files\VideoLAN\VLC\lua\playlist as a basic text file called youtube.luac (renaming the original youtube.luac out of the way). . . there may be a way of configuring VLC to use yt-dlp4vlc[.luac?] but don't ask me how. Next up yt-dlp.exe running on XP. This one from October last year is working for me. . . https://github.com/nicolaasjan/yt-dlp/releases/download/2025.10.29.063241/yt-dlp_x86_winXP.exe . . .which goes into C:\Program Files\VideoLAN\VLC renamed to yt-dlp.exe That just leaves hidecon.exe (found in bin.x86-32) which also goes into C:\Program Files\VideoLAN\VLC http://code.kliu.org/misc/hidecon/hidecon-1.2.2-redist.7z With that I was good to go. Ben.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now