Opened 3 years ago

Closed 2 years ago

#7471 closed patch (fixed)

Playing YouTube clips stopped working

Reported by: boyvanamstel Owned by: linkfanel
Priority: normal Milestone: 2.0.4
Component: LUA scripts Version: master git
Severity: major Keywords: lua, youtube, fix
Cc: Difficulty: easy
Platform(s): all Work status: Almost finished

Description

Excerpt: Normally you'd be able to feed YouTube? urls to VLC (via drag/drop, command line, 'open stream) and the lua parser would allow the clip to play in VLC.

Problem: YouTube? changed something and now clips fail with a 'Couldn't extract youtube video URL, please check for updates to this script'.

Fix: I've updated the lua script and uploaded it as a gist: https://gist.github.com/3729932 Updated code starts at line 141 and ends at line 158.

Just needs merging and a little testing on platforms other than OSX.

Details: It adds another way to retrieve direct links to the YouTube? clips. Inspired by rg3's youtube-dl (https://github.com/rg3/youtube-dl).

Attachments (3)

youtube.lua (7.3 KB) - added by boyvanamstel 3 years ago.
YouTube? lua parser. Latest version at: https://gist.github.com/3729932
youtube_lua-signature.patch (1.2 KB) - added by https://www.google.com/accounts/o8/id?id=aitoawmbh5ndx2l8pa3xg5cfcslolc1ekhckxeo 3 years ago.
add signature parameter to url for old youtube.lua
youtube.luac (7.8 KB) - added by https://me.yahoo.com/get_iplayer#1f7c3 3 years ago.
Revised parser youtube.lua (Mac)/youtube.luac (Windows) INCLUDING signature patch

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by boyvanamstel

YouTube? lua parser. Latest version at: https://gist.github.com/3729932

comment:1 Changed 3 years ago by linkfanel@…

  • Resolution set to fixed
  • Status changed from new to closed

commit aaf17f6592d2cf8f122ed6d9291a8eadb4812576 Author: Pierre Ynard <linkfanel@…> Date: Mon Sep 17 05:54:59 2012 +0200

youtube.lua: use alternative API URL

It seems that the normal URLs included in the web page miss a "signature" field and return 403 errors now. This approach has a number of issues, it requires an extra HTTP request, still seems to fail due to lack of signatures, and have different access restrictions than the the web pages.

This shall meet the popular demand for now.

Closes #7471

comment:2 Changed 3 years ago by jb

  • Milestone changed from Bugs paradize to 2.0.4

Changed 3 years ago by https://www.google.com/accounts/o8/id?id=aitoawmbh5ndx2l8pa3xg5cfcslolc1ekhckxeo

add signature parameter to url for old youtube.lua

comment:3 follow-up: Changed 3 years ago by https://www.google.com/accounts/o8/id?id=aitoawmbh5ndx2l8pa3xg5cfcslolc1ekhckxeo

I can confirm that the commit aaf17f6592d2cf8f122ed6d9291a8eadb4812576 fixes the issue.

The former script could be fixed with the newly attached patch, since all that was missing was the signature parameter - and also a swap of itag and url parameters.

The new youtube.lua is a bit more readable than before so I'm not sure it's worth going back to it. =)

Last edited 3 years ago by https://www.google.com/accounts/o8/id?id=aitoawmbh5ndx2l8pa3xg5cfcslolc1ekhckxeo (previous) (diff)

comment:4 Changed 3 years ago by linkfanel@…

commit 3a4021cfde854da79675fa67df47fc4f463f264b Author: Pierre Ynard <linkfanel@…> Date: Fri Sep 28 04:15:49 2012 +0200

youtube.lua: parse signature parameter

It was in fact still there, but as a separate parameter. We keep the alternate API as a fallback for the next time things break, maybe.

Ref #7471

comment:5 in reply to: ↑ 3 Changed 3 years ago by linkfanel

Replying to https://www.google.com/accounts/o8/id?id=aitoawmbh5ndx2l8pa3xg5cfcslolc1ekhckxeo:

I tried to find the signature somewhere but I couldn't find it, thanks a lot for the pointer!

Changed 3 years ago by https://me.yahoo.com/get_iplayer#1f7c3

Revised parser youtube.lua (Mac)/youtube.luac (Windows) INCLUDING signature patch

comment:6 Changed 3 years ago by https://me.yahoo.com/get_iplayer#1f7c3

Attachment https://trac.videolan.org/vlc/attachment/ticket/7471/youtube.luac [revised parser youtube.lua (Mac) / youtube.luac (Windows) including signature patch] confirmed working on Windows 7 Ultimate

comment:7 Changed 2 years ago by randy tjahjono

  • Resolution fixed deleted
  • Status changed from closed to reopened

This seems to be broken again in 2.0.6. I am using 64-bit Windows 7. The error is "lua error: Couldn't extract youtube video URL, please check for updates to this script"

comment:8 Changed 2 years ago by jb

  • Resolution set to fixed
  • Status changed from reopened to closed

This is not the same issue. Please don't reopen old tickets.

Note: See TracTickets for help on using tickets.