ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.46k stars 9.96k forks source link

Invalid duration of youtube video reported by --dump-json #22314

Closed wszak closed 5 years ago

wszak commented 5 years ago

Checklist

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-j', u'-v', u'tUmWbZ2HCp4']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2019.09.01
[debug] Python version 2.7.15rc1 (CPython) - Linux-4.19.66-1-MANJARO-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[debug] Default format spec: bestvideo+bestaudio/best

{
    "_filename": "live Ashra Mjalis (Z Qazi wasim abas Multan)  04 Muhrram Thallah Syedan G14 Islamabad 2019-tUmWbZ2HCp4.mp4",
    "abr": 128,
    "acodec": "mp4a.40.2",
    "age_limit": 0,
    "album": null,
    "alt_title": null,
    "annotations": null,
    "artist": null,
    "automatic_captions": {},
    "average_rating": 4.8415842,
    "categories": [
        "People & Blogs"
    ],
    "channel_id": "UCgBWyQBWQ0Lduws9sIvr6Ig",
    "channel_url": "http://www.youtube.com/channel/UCgBWyQBWQ0Lduws9sIvr6Ig",
    "chapters": null,
    "creator": null,
    "description": "official video of http://wwvw.talagangazadari.com like http://www.facebook.com/TalagangAzadari Whatsapp +923045121476 +923349457214",
    "dislike_count": 4,
    "display_id": "tUmWbZ2HCp4",
    "duration": 1,

Description

WRITE DESCRIPTION HERE The --dump-json reports duration=1 while the video is over 1 hour long. Use this command: youtube-dl -j 'https://www.youtube.com/watch?v=tUmWbZ2HCp4' > tUmWbZ2HCp4.json Look into the json file and you'll see that duration is reported as 1.

If this is for some reason a 'nofix', then at least tell me how to determine when the duration field is invalid. Maybe youtube-dl should sum the formats/duration fields to calculate the final duration?

remitamine commented 5 years ago

both videos report the correct duration.

youtube-dl -j tUmWbZ2HCp4 | jq .duration
4131
youtube-dl -j 3IJYHdq36io | jq .duration
145