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

view_count incorrect for YouTube videos when downloading playlists #27051

Closed
6 tasks done
apaloma opened this issue Nov 17, 2020 · 3 comments
Closed
6 tasks done

view_count incorrect for YouTube videos when downloading playlists #27051

apaloma opened this issue Nov 17, 2020 · 3 comments

Comments

@apaloma
Copy link

apaloma commented Nov 17, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.11.17
  • 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 bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

$ youtube-dl --output "Testing views - %(id)s - %(view_count)s views.%(ext)s" -f best -ciw -v --playlist-end 2 https://www.youtube.com/c/WhiteHouse/videos
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--output', u'Testing views - %(id)s - %(view_count)s views.%(ext)s', u'-f', u'best', u'-ciw', u'-v', u'--playlist-end', u'2', u'https://www.youtube.com/c/WhiteHouse/videos']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.11.17
[debug] Python version 2.7.12 (CPython) - Linux-4.4.0-194-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 2.8.17, ffprobe 2.8.17, rtmpdump 2.4
[debug] Proxy map: {}
[youtube:tab] WhiteHouse: Downloading webpage
[download] Downloading playlist: The White House - Videos
[youtube:tab] playlist The White House - Videos: Downloading 2 videos
[download] Downloading video 1 of 2
[youtube] TYwbGPxQLrs: Downloading webpage
[debug] Invoking downloader on u'https://r4---sn-nx5s7n7d.googlevideo.com/videoplayback?expire=1605660990&ei=3hy0X82EEsS9kwbFrpjgCg&ip=174.21.186.35&id=o-APO0IFOHuwehZifFfgAlh8iWFZCuPddjQ16EA9jt3eoG&itag=22&source=youtube&requiressl=yes&mh=KA&mm=31%2C29&mn=sn-nx5s7n7d%2Csn-nx57ynld&ms=au%2Crdu&mv=m&mvi=4&pl=17&initcwndbps=972500&vprv=1&mime=video%2Fmp4&ns=7yoOMXuPsIbPExmPWb9yeT4F&ratebypass=yes&dur=1949.431&lmt=1605528545444526&mt=1605639281&fvip=4&c=WEB&txp=5535432&n=gGJN5CyG1lSCoBp&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRAIgcyg__PDSl9ShJb3YZNKWYvGk3PkOsnoIu-XqHxaE78YCIF9TdpxkfjdVOacru9aV6T1z_jakGHhkhEGplWT-tAgJ&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgLVFv5EkLIia4Cdt7Y4Y7-U-Z99JXi4cUL3Lx1JDlM8QCIQCNraCiD9aiz921r-XQQkJsa3KxNVzNaxMZMXJ9tow0BA%3D%3D'
[download] Destination: Testing views - TYwbGPxQLrs - 102 views.mp4
[download] 100% of 182.84MiB in 00:04
[download] Downloading video 2 of 2
[youtube] rD1FNeaTlSM: Downloading webpage
[debug] Invoking downloader on u'https://r4---sn-nx5e6ne6.googlevideo.com/videoplayback?expire=1605660995&ei=4xy0X4zpNszFkgarvK_oBg&ip=174.21.186.35&id=o-AOKFenHaoz2FczfrfZzb8GRFMj5fCF12HQHYg2XrcZEu&itag=22&source=youtube&requiressl=yes&mh=U7&mm=31%2C29&mn=sn-nx5e6ne6%2Csn-nx5s7n76&ms=au%2Crdu&mv=m&mvi=4&pl=17&initcwndbps=972500&vprv=1&mime=video%2Fmp4&ns=5X6BJkYcT0l9fzRCvxCRAiAF&ratebypass=yes&dur=38.312&lmt=1605297093596521&mt=1605639281&fvip=4&c=WEB&txp=5432434&n=4rTnp3eDT62SYQ1&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRAIgEFki_vd30zl5_JShwxBasSe5z3kErEKtq-3WApdaVBICIE6fccMwbrabGN7T1l9MME3bGBR2Iekz3OmnGnJcuTLz&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbu1Y_h6YWE8PD35J6pPZc351bZaNjweMOIpGaeQo9CoCIQCM8J8YkB9evdD5swap0iPy5mgSwBJlEhj_49fcG_drbA%3D%3D'
[download] Destination: Testing views - rD1FNeaTlSM - 25 views.mp4
[download] 100% of 2.07MiB in 00:00
[download] Finished downloading playlist: The White House - Videos

Description

It seems that the parsing of view counts on youtube videos does not work correctly when a playlist or channel is provided. For example, if a video has 102K views, then view_count will be 102. If "102K" is all that is provided by YouTube's API, then I think %(view_count)s returning 102K would be appropriate.

A single video works OK:

$ youtube-dl --output "Testing views - %(view_count)s views.%(ext)s" -f best -ciw -v http://www.youtube.com/watch?v=BaW_jenozKcj
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--output', u'Testing views - %(view_count)s views.%(ext)s', u'-f', u'best', u'-ciw', u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.11.17
[debug] Python version 2.7.12 (CPython) - Linux-4.4.0-194-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 2.8.17, ffprobe 2.8.17, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] BaW_jenozKc: Downloading webpage
[debug] Invoking downloader on u'https://r3---sn-nx5e6nez.googlevideo.com/videoplayback?expire=1605660761&ei=-Ru0X7bOIoiBkwa4pKjAAQ&ip=174.21.186.35&id=o-AD1cg_zIDxBXeEnGJ8x16Eyk3BGofcA3rRjp84-EIL7x&itag=22&source=youtube&requiressl=yes&mh=Rf&mm=31%2C29&mn=sn-nx5e6nez%2Csn-nx5s7n76&ms=au%2Crdu&mv=m&mvi=3&pl=17&initcwndbps=980000&vprv=1&mime=video%2Fmp4&ns=n_dFP_H3cOHtaHFIrZr4UtMF&ratebypass=yes&dur=9.891&lmt=1472250137564567&mt=1605639039&fvip=3&c=WEB&n=ah1IhGWC4fRbAys&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIgVNeRKWZO1d28fig-nDLo4CdFnh8ZDXF9pwEhYDFbD4UCIQDtAg_V3BpRnZeSoh9ecwILfIIJ7PMbx8ycfYBIHo6Hsg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgJ0AKHTweBZY_NfKifdTFezfNClzIqbpQaZfQ3Hoz9eYCIQC0peFptF5dxY1FazZa3IR7BfbhUEoAwaP1GZZULnTAiQ%3D%3D'
[download] Destination: Testing views - 32705 views.mp4
[download] 100% of 1.74MiB in 00:00
@patryk-siewiera
Copy link

I could confirm this; all of my parsed views are /1000 smaller

@apaloma
Copy link
Author

apaloma commented Dec 1, 2020

remitamine fixed it. Try the latest version.

@patryk-siewiera
Copy link

I still got this issue in embed python version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants