1. Forum
  2. Letzte Aktivitäten
  3. Unerledigte Themen
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Forum
  • Articles
  • Pages
  • More Options
  1. VLC Player Forum
  2. Der VLC Player
  3. Fragen zum VLC Media Player

Altes Problem stets wieder neu: VLC player spielt Youtube Videos nicht ab

  • B-OHNE
  • April 8, 2025 at 9:54 PM
  • Thread is Resolved
1st Official Post
  • B-OHNE
    Anfänger
    Posts
    6
    • April 8, 2025 at 9:54 PM
    • #1

    ... das wesentliche ist gesagt, ohne ersichtlichen Grund spielt mein VLC player seit ein paar Tagen keine Youtube Videos mehr ab - auf allen vier Windows Rechnern.


    Bisher hatte ich in diesem Falle immer eine Lösung im Netz finden und erfolgreich anwenden können, zuletzt das kopieren einer neueren .lua Datei in das entsprechende Verzeichnis.

    Aber gerade finde ich keine Lösung.

    Haben noch andere das Problem gerade? Gibt es schon eine Lösung? DANKE!

  • thweiss
    Moderator
    Reactions Received
    239
    Posts
    3,051
    • April 9, 2025 at 12:22 PM
    • Official Post
    • #2

    Hallo B-Ohne,

    in der Rubrik "Informationen zum VLC-Player und Forum" und "A6 Häufig gestellte Fragen zum VLC-Player" habe ich die Frage "Wie gibt man Videos von Youtube im VLC-Player wieder?" mit der aktuellen Lösung ergänzt.

    Thread

    Wiedergabe von YouTube-Videos auf dem PC

    .

    Wie gibt man Videos von YouTube im VLC Player wieder?

    Immer wieder taucht die Frage auf, wie Videos von YouTube mit dem VLC media player aufgenommen oder direkt wiedergegeben werden können. Daher will ich hier in kurzer Form eine Antwort darauf geben. Dabei wird davon ausgegangen, dass VLC in der Version 2.0.5 verwendet wird (auch Version 2.0.8 funktioniert) und der Anwender auf der Page von YouTube die Link-Adresse für das jeweilige Video in die Zwischenablage kopiert hat.

    1. Direkte…
    kodela
    January 22, 2013 at 10:10 AM

    Man lädt sich die Datei "yt-dlp.exe" von Github herunter und speichert diese im Installationsverzeichnis, wo die Datei "Vlc.exe" liegt.

    Zusätzlich fügt man in das Installationsverzeichnis des VLC-Players ...\VideoLAN\VLC\lua\playlist\ eine "youtube-dl.luac" Datei hinzu, siehe Hinweise.

    MfG
    Thomas

    Edited once, last by thweiss (April 9, 2025 at 5:03 PM).

    • Next Official Post
  • B-OHNE
    Anfänger
    Posts
    6
    • April 10, 2025 at 6:46 PM
    • #3

    Hej Thomas, 1000 Dank!

    Sobald ich mal wieder 5 Minuten habe, werde ich es anwenden und berichten, ob es geklappt hat.


    Herzliche Grüße

  • B-OHNE
    Anfänger
    Posts
    6
    • April 10, 2025 at 7:32 PM
    • #4

    ...so jetzt einmal probiert, aber irgendwie haut es noch nicht hin.

    ... zuletzt öffente sich das commando Fenster, während in der Steuerung die gelbe Linie hin und herfährt ?!

  • B-OHNE
    Anfänger
    Posts
    6
    • April 10, 2025 at 10:39 PM
    • #5

    ... und jetzt habe ich einfach etwas gewartet und dann funktioniert das streamen tatsächlich, es dauert lediglich ca.eine Minunte, bis das Video startet.


    Klasse, DANKE!

    Edited once, last by B-OHNE (April 10, 2025 at 11:01 PM).

  • B-OHNE
    Anfänger
    Posts
    6
    • April 11, 2025 at 11:00 AM
    • #6

    ... jetzt hatte ich doch noch eine Frage.

    Leider werden die Youtube Filme nicht in der höchsten Auflösung gestreamt.

    Ist dieses Problem bekannt und wenn ja schon gelöst?

    In dem englischsprachigen Forum erscheint diese Frage ebenfalls vor zwei Tagen aber wurde nicht beantwortet.


    Danke!

    Edited once, last by B-OHNE (April 11, 2025 at 11:03 AM).

  • thweiss
    Moderator
    Reactions Received
    239
    Posts
    3,051
    • April 11, 2025 at 7:20 PM
    • Official Post
    • #7

    Man kann eine höhere Streamauflösung auswählen, die ist dann allerdings ohne Ton.
    Dafür die geänderte youtube-dl.luac Datei im Verzeichnis ...\VideoLAN\VLC\lua\playlist\ ersetzen, siehe Code:

    Code
    -- If you experience some problems with with the old buggy dkjson version, like in issue #3
    -- You need to download the latest version of dkjson until https://code.videolan.org/videolan/vlc/-/merge_requests/3318 is merged.
    
    JSON = require "dkjson" -- load additional json routines
    
    -- Probe function.
    function probe()
        if vlc.access == "http" or vlc.access == "https" then
            peeklen = 9
            s = ""
            while string.len(s) < 9 do
                s = string.lower(string.gsub(vlc.peek(peeklen), "%s", ""))
                peeklen = peeklen + 1
            end
            return s == "<!doctype"
        else
            return false
        end
    end
    
    function _get_format_url(format)
        -- prefer streaming formats
        if format.manifest_url then
            return format.manifest_url
        else
            return format.url
        end
    end
    
    -- Parse function.
    function parse()
        local url = vlc.access .. "://" .. vlc.path -- get full url
    
        -- Function to execute command and return file handle or nil on failure
        local function execute_command(command)
            local file = io.popen(command, 'r')
            if file then
                local output = file:read("*a")    -- Attempt to read something to check if command worked
                if output == "" then              -- If nothing was read, assume command failed (like command not found)
                    file:close()                  -- Important to close to avoid resource leaks
                    return nil                    -- Indicate failure
                else
                    file:close()                  -- Close and reopen for actual usage
                    return io.popen(command, 'r') -- Reopen since we consumed the initial read
                end
            else
                return nil -- Command execution failed
            end
        end
    
        -- Try executing youtube-dl command
        local file = execute_command('youtube-dl -j -f 136 --flat-playlist "' .. url .. '"')
        if not file then
            -- If youtube-dl fails, try yt-dlp as a fallback
            file = assert(execute_command('yt-dlp -j -f 136 --flat-playlist "' .. url .. '"'),
                "Both youtube-dl and yt-dlp failed to execute.")
        end
    
    
        local tracks = {}
        while true do
            local output = file:read('*l')
    
            if not output then
                break
            end
    
            local json = JSON.decode(output) -- decode the json-output from youtube-dl
    
            if not json then
                break
            end
    
            local outurl = json.url
            local out_includes_audio = true
            local audiourl = nil
            if not outurl then
                if json.requested_formats then
                    for key, format in pairs(json.requested_formats) do
                        if format.vcodec ~= (nil or "none") then
                            outurl = _get_format_url(format)
                            out_includes_audio = format.acodec ~= (nil or "none")
                        end
    
                        if format.acodec ~= (nil or "none") then
                            audiourl = _get_format_url(format)
                        end
                    end
                else
                    -- choose best
                    for key, format in pairs(json.formats) do
                        outurl = _get_format_url(format)
                    end
                    -- prefer audio and video
                    for key, format in pairs(json.formats) do
                        if format.vcodec ~= (nil or "none") and format.acodec ~= (nil or "none") then
                            outurl = _get_format_url(format)
                        end
                    end
                end
            end
    
            if outurl then
                if (json._type == "url" or json._type == "url_transparent") and json.ie_key == "Youtube" then
                    outurl = "https://www.youtube.com/watch?v=" .. outurl
                end
    
                local category = nil
                if json.categories then
                    category = json.categories[1]
                end
    
                local year = nil
                if json.release_year then
                    year = json.release_year
                elseif json.release_date then
                    year = string.sub(json.release_date, 1, 4)
                elseif json.upload_date then
                    year = string.sub(json.upload_date, 1, 4)
                end
    
                local thumbnail = nil
                if json.thumbnails then
                    thumbnail = json.thumbnails[#json.thumbnails].url
                end
    
                jsoncopy = {}
                for k in pairs(json) do
                    jsoncopy[k] = tostring(json[k])
                end
    
                json = jsoncopy
    
                item = {
                    path        = outurl,
                    name        = json.title,
                    duration    = json.duration,
    
                    -- for a list of these check vlc/modules/lua/libs/sd.c
                    title       = json.track or json.title,
                    artist      = json.artist or json.creator or json.uploader or json.playlist_uploader,
                    genre       = json.genre or category,
                    copyright   = json.license,
                    album       = json.album or json.playlist_title or json.playlist,
                    tracknum    = json.track_number or json.playlist_index,
                    description = json.description,
                    rating      = json.average_rating,
                    date        = year,
                    --setting
                    url         = json.webpage_url or url,
                    --language
                    --nowplaying
                    --publisher
                    --encodedby
                    arturl      = json.thumbnail or thumbnail,
                    trackid     = json.track_id or json.episode_id or json.id,
                    tracktotal  = json.n_entries,
                    --director
                    season      = json.season or json.season_number or json.season_id,
                    episode     = json.episode or json.episode_number,
                    show_name   = json.series,
                    --actors
    
                    meta        = json,
                    options     = { "start-time=" .. (json.start_time or 0) },
                }
    
                if not out_includes_audio and audiourl and outurl ~= audiourl then
                    item['options'][':input-slave'] = ":input-slave=" .. audiourl;
                end
    
                table.insert(tracks, item)
            end
        end
        file:close()
        return tracks
    end
    Display More

    Am besten du befasst dich mit dem Kommandozeilentool yt-dlp.exe etwas genauer, siehe Links.

    YT-DLP verwenden | Anleitung für Anfänger(2025)
    Die Verwendung von YT-DLP ist einfach zu verstehen, sobald Sie es auf Ihrem PC installiert haben. Allerdings benötigt es Erweiterungen und andere Elemente, um…
    multimedia.easeus.com

    Das Kommandozeilentool yt-dlp.exe ist für das Herunterladen der Inhalte besser geeignet.

    MfG
    Thomas

    Edited 2 times, last by thweiss (April 12, 2025 at 12:41 PM).

    • Previous Official Post

Registrierung

Don’t have an account yet? Register yourself now and be a part of our community!

Register Yourself

Users Viewing This Thread

  • 1 Guest
  1. Datenschutzerklärung
  2. Impressum
  3. Kontakt
  4. Download VLC Player
  5. OpenOffice Download