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] Improve extraction of video duration #11841

Closed
cristalix opened this issue Jan 26, 2017 · 0 comments
Closed

[youtube] Improve extraction of video duration #11841

cristalix opened this issue Jan 26, 2017 · 0 comments

Comments

@cristalix
Copy link

@cristalix cristalix commented Jan 26, 2017

Hi,
suggestion how to improve extraction of video duration. Note: I'm nod good in python :) This is current code how ytdl extract duration info about video, isn't it:

if 'length_seconds' not in video_info:
    self._downloader.report_warning('unable to extract video duration')
    video_duration = None
else:
    video_duration = int(compat_urllib_parse_unquote_plus(video_info['length_seconds'][0]))

There is duration info also in https://www.youtube.com/watch?v=GcjcbqQAjfk page in header under property:

<meta itemprop="duration" content="PT6M41S">

It's in some YT, let's say, specific format :)

@dstftw dstftw closed this in 556dbe7 Jan 26, 2017
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.