Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube Premium episode info not extracted for trending videos #21752

Open
nyuszika7h opened this issue Jul 12, 2019 · 0 comments
Open

YouTube Premium episode info not extracted for trending videos #21752

nyuszika7h opened this issue Jul 12, 2019 · 0 comments

Comments

@nyuszika7h
Copy link
Contributor

@nyuszika7h nyuszika7h commented Jul 12, 2019

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2019.07.12
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-o', '%(series)s S%(season_number)02dE%(episode_number)02d %(episode)s %(height)dp.%(ext)s', 'https://www.youtube.com/watch?v=SgJtS0BU-UY']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.07.12
[debug] Python version 3.5.3 (CPython) - Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
[debug] exe versions: ffmpeg N-94165-g6e988b75df, ffprobe N-94165-g6e988b75df
[debug] Proxy map: {}
[youtube] SgJtS0BU-UY: Downloading webpage
[youtube] SgJtS0BU-UY: Downloading video info webpage
[youtube] {22} signature length 109, html5 player vflK6rDhN
[youtube] {43} signature length 109, html5 player vflK6rDhN
[youtube] {18} signature length 109, html5 player vflK6rDhN
[youtube] {313} signature length 105, html5 player vflK6rDhN
[youtube] {271} signature length 105, html5 player vflK6rDhN
[youtube] {137} signature length 105, html5 player vflK6rDhN
[youtube] {248} signature length 105, html5 player vflK6rDhN
[youtube] {136} signature length 109, html5 player vflK6rDhN
[youtube] {247} signature length 109, html5 player vflK6rDhN
[youtube] {135} signature length 109, html5 player vflK6rDhN
[youtube] {244} signature length 105, html5 player vflK6rDhN
[youtube] {134} signature length 105, html5 player vflK6rDhN
[youtube] {243} signature length 109, html5 player vflK6rDhN
[youtube] {133} signature length 109, html5 player vflK6rDhN
[youtube] {242} signature length 109, html5 player vflK6rDhN
[youtube] {160} signature length 109, html5 player vflK6rDhN
[youtube] {278} signature length 109, html5 player vflK6rDhN
[youtube] {140} signature length 105, html5 player vflK6rDhN
[youtube] {171} signature length 109, html5 player vflK6rDhN
[youtube] {249} signature length 105, html5 player vflK6rDhN
[youtube] {250} signature length 109, html5 player vflK6rDhN
[youtube] {251} signature length 105, html5 player vflK6rDhN
[youtube] {256} signature length 109, html5 player vflK6rDhN
[youtube] {258} signature length 105, html5 player vflK6rDhN
[debug] Default format spec: bestvideo+bestaudio/best
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on 'https://r3---sn-4g5ednsr.googlevideo.com/videoplayback?expire=1562953798&ei=5nMoXcqjK8Sz8gOpn6m4CA&ip=2a01%3A4f8%3A161%3A53e5%3A%3A2&id=o-AAqAEIQIh8qAvCm91PT4k
h-hglwnDjhuXNU7cmmSUy87&itag=313&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C271%2C278%2C313&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-4g5ednsr%2Csn-4g5e6nze
&ms=au%2Crdu&mv=m&mvi=2&pl=43&gcr=de&initcwndbps=782500&mime=video%2Fwebm&gir=yes&clen=2847083741&dur=2017.598&lmt=1559324335037633&mt=1562932046&fvip=3&keepalive=yes&c=WEB&txp=6516222&sparam
s=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cgcr%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRAIgOQTPp1dUf67ySU5dp7TVyX2fT9ddS
fpdARG3cB-APIYCIBcdsUxHvvL6e6R8Tuc5453wpGfb5ZYKf5RHSEZzb9XL&sig=ALgxI2wwRAIgNyiyi7J0QE53P3JU1G1d-yE9NheJ2fUE1cvljuI4hxoCIBdR9q0exES6bG8Mg2yEDXJJjt9v4OpNt9cfR3nHl2pZ&ratebypass=yes'
[download] Destination: NA SNAENA NA 2160p.f313.webm
[download]   1.5% of 2.65GiB at 45.93MiB/s ETA 00:58^C
ERROR: Interrupted by user

Description

When a video is trending, the usual way of extracting the episode info for YouTube Premium series doesn't work. This can be circumvented by either using a country where it's not trending, or changing the way the info is extracted.

% curl -s 'https://www.youtube.com/watch?v=SgJtS0BU-UY&gl=US&hl=en&has_verified=1&bpctr=9999999999' | grep -A1 watch7-headline
      <div id="watch7-headline" class="clearfix">
        <span class="standalone-collection-badge-renderer-text"><a href="/feed/trending" class=" yt-uix-sessionlink      spf-link " data-sessionlink="ei=SnQoXe3_GIuo7gPv4ryABw" >#2 on Trending</a></span>

% curl -s 'https://www.youtube.com/watch?v=SgJtS0BU-UY&gl=DE&hl=en&has_verified=1&bpctr=9999999999' | grep -A1 watch7-headline
      <div id="watch7-headline" class="clearfix">
        <span class="standalone-collection-badge-renderer-text"><b><a href="/playlist?list=PLRfpyIF9ZtKKGplgKE3JxuHGaF3HMvZtq" class=" yt-uix-sessionlink      spf-link " data-sessionlink="ei=T3QoXbjICdOW1gLNgImYBA" >Escape the Night</a></b> S4 • E1</span>

This is a basic regex that could work on the video title and would also extract the episode title, but it becomes ambiguous if the series and/or episode title contains a hyphen:

>>> re.fullmatch(r'(.+) - (.+) S(\d+) \(Ep (\d+)\)', 'Collecting The Dead: Part 1 - Escape the Night S4 (Ep 1)').groups()
('Collecting The Dead: Part 1', 'Escape the Night', '4', '1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.