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

When I try to download the whole playlist on Youtube, It stucks #9266

Closed
KwToPA opened this issue Apr 21, 2016 · 14 comments
Closed

When I try to download the whole playlist on Youtube, It stucks #9266

KwToPA opened this issue Apr 21, 2016 · 14 comments

Comments

@KwToPA
Copy link

@KwToPA KwToPA commented Apr 21, 2016

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.04.19. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • [x ] I've verified and I assure that I'm running youtube-dl 2016.04.19

Before submitting an issue make sure you have:

  • [x ] At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • [ x] Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

proxychains4 youtube-dl --playlist-items 3-6 -f bestvideo+bestaudio --external-downloader aria2c https://www.youtube.com/watch?v=WAmtH91S2GQ&list=PLwXMmy5fUrVw2prjsGuKla15LPRVnSv6G
[proxychains] config file found: /usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.7/lib/libproxychains4.dylib
[proxychains] DLL init
[proxychains] DLL init
[proxychains] DLL init
[youtube] WAmtH91S2GQ: Downloading webpage
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  www.youtube.com:443  ...  OK
[youtube] WAmtH91S2GQ: Downloading video info webpage
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  www.youtube.com:443  ...  OK
[youtube] WAmtH91S2GQ: Extracting video information
[youtube] WAmtH91S2GQ: Downloading MPD manifest
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  manifest.googlevideo.com:443  ...  OK
...
then it stucks. Do I use the wrong syntax?   Thanks.
- Playlist: https://www.youtube.com/watch?v=WAmtH91S2GQ&list=PLwXMmy5fUrVw2prjsGuKla15LPRVnSv6G

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 21, 2016

Most likely it's a problem of proxychains. Is proxychains correctly configured for accessing https://manifest.googlevideo.com:443/?

@KwToPA
Copy link
Author

@KwToPA KwToPA commented Apr 21, 2016

Thank you for your assistance.

# proxychains.conf  VER 4.x
#
#        HTTP, SOCKS4a, SOCKS5 tunneling proxifier with DNS.


# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
#
#dynamic_chain
#
# Dynamic - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
#
strict_chain
#
# Strict - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
#
#round_robin_chain
#
# Round Robin - Each connection will be done via chained proxies
# of chain_len length
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped).
# the start of the current proxy chain is the proxy after the last
# proxy in the previously invoked proxy chain.
# if the end of the proxy chain is reached while looking for proxies
# start at the beginning again.
# otherwise EINTR is returned to the app
# These semantics are not guaranteed in a multithreaded environment.
#
#random_chain
#
# Random - Each connection will be done via random proxy
# (or proxy chain, see  chain_len) from the list.
# this option is good to test your IDS :)

# Make sense only if random_chain or round_robin_chain
#chain_len = 2

# Quiet mode (no output from library)
#quiet_mode

# Proxy DNS requests - no leak for DNS data
proxy_dns 

# set the class A subnet number to use for the internal remote DNS mapping
# we use the reserved 224.x.x.x range by default,
# if the proxified app does a DNS request, we will return an IP from that range.
# on further accesses to this ip we will send the saved DNS name to the proxy.
# in case some control-freak app checks the returned ip, and denies to 
# connect, you can use another subnet, e.g. 10.x.x.x or 127.x.x.x.
# of course you should make sure that the proxified app does not need
# *real* access to this subnet. 
# i.e. dont use the same subnet then in the localnet section
#remote_dns_subnet 127 
#remote_dns_subnet 10
remote_dns_subnet 224

# Some timeouts in milliseconds
tcp_read_time_out 15000
tcp_connect_time_out 8000

### Examples for localnet exclusion
## localnet ranges will *not* use a proxy to connect.
## Exclude connections to 192.168.1.0/24 with port 80
# localnet 192.168.1.0:80/255.255.255.0

## Exclude connections to 192.168.100.0/24
# localnet 192.168.100.0/255.255.255.0

## Exclude connections to ANYwhere with port 80
# localnet 0.0.0.0:80/0.0.0.0

## RFC5735 Loopback address range
## if you enable this, you have to make sure remote_dns_subnet is not 127
## you'll need to enable it if you want to use an application that 
## connects to localhost.
# localnet 127.0.0.0/255.0.0.0

## RFC1918 Private Address Ranges
# localnet 10.0.0.0/255.0.0.0
# localnet 172.16.0.0/255.240.0.0
# localnet 192.168.0.0/255.255.0.0

# ProxyList format
#       type  ip  port [user pass]
#       (values separated by 'tab' or 'blank')
#
#       only numeric ipv4 addresses are valid
#
#
#        Examples:
#
#               socks5  192.168.67.78   1080    lamer   secret
#       http    192.168.89.3    8080    justu   hidden
#       socks4  192.168.1.49    1080
#           http    192.168.39.93   8080    
#       
#
#       proxy types: http, socks4, socks5
#        ( auth types supported: "basic"-http  "user/pass"-socks )
#
[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
#socks4     127.0.0.1 9050
socks5 127.0.0.1 1080

This is my default config document. I don't know how to configure for accessing https://manifest.googlevideo.com:443/

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 21, 2016

You're using a local SOCK5 proxy 127.0.0.1:1080. Please check against it.

@KwToPA
Copy link
Author

@KwToPA KwToPA commented Apr 21, 2016

Yes I use a local SOCK5 proxy 127.0.0.1:1080 and it connects the shadowsocks https://github.com/shadowsocks/shadowsocks I couldn't open youtube or google directly in my country.

The ordinary command works such as proxychains4 youtube-dl URL

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 21, 2016

What's the result of the following command?

curl --socks5 127.0.0.1:1080 https://manifest.googlevideo.com:443/

AFAIK shadowsocks requires deploying a server. I may be unable to reproduce the same result due to different relay servers. If the server you're using doesn't work for https://manifest.googlevideo.com:443/ and you don't have other servers for testing, you can use the following option to skip it:

youtube-dl -vF "WAmtH91S2GQ" --youtube-skip-dash-manifest

Note that using this option may cause some formats missing.

@KwToPA
Copy link
Author

@KwToPA KwToPA commented Apr 21, 2016

I run

curl --socks5 127.0.0.1:1080 https://manifest.googlevideo.com:443/

it SHOWS

curl: (35) Server aborted the SSL handshake

And I change to

proxychains4 curl https://manifest.googlevideo.com:443/
[proxychains] config file found: /usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.7/lib/libproxychains4.dylib
[proxychains] DLL init
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  manifest.googlevideo.com:443  ...  OK
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/</code> was not found on this server.  <ins>That’s all we know.</ins>
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 21, 2016

Seems I was wrong and the problem is not in https://manifest.googlevideo.com:443/. How did you install youtube-dl? If you can find the file youtube_dl/__init__.py, please delete the following two lines from it: (They are near the end of the file)

    except KeyboardInterrupt:
        sys.exit('\nERROR: Interrupted by user')

Then try again and post the results.

@KwToPA
Copy link
Author

@KwToPA KwToPA commented Apr 21, 2016

Nothing changed

proxychains4 youtube-dl --playlist-items 3-6 -f bestvideo+bestaudio --external-downloader aria2c https://www.youtube.com/watch?v=WAmtH91S2GQ&list=PLwXMmy5fUrVw2prjsGuKla15LPRVnSv6G
[proxychains] config file found: /usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.7/lib/libproxychains4.dylib
[proxychains] DLL init
[proxychains] DLL init
[proxychains] DLL init
[youtube] WAmtH91S2GQ: Downloading webpage
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  www.youtube.com:443  ...  OK
[youtube] WAmtH91S2GQ: Downloading video info webpage
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  www.youtube.com:443  ...  OK
[youtube] WAmtH91S2GQ: Extracting video information
[youtube] WAmtH91S2GQ: Downloading MPD manifest
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  manifest.googlevideo.com:443  ...  OK

Then I press command+c

[1]+  Stopped                 proxychains4 youtube-dl --playlist-items 3-6 -f bestvideo+bestaudio --external-downloader aria2c https://www.youtube.com/watch?v=WAmtH91S2GQ
@KwToPA
Copy link
Author

@KwToPA KwToPA commented Apr 21, 2016

May be I used to use this command to install youtube-dl

sudo pip install youtube-dl

I forgot the details

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 21, 2016

Command+C should not generate "Stopped". Please post the output of

proxychains4 youtube-dl -v --playlist-items 3-6 -f bestvideo+bestaudio --external-downloader aria2c "https://www.youtube.com/watch?v=WAmtH91S2GQ&list=PLwXMmy5fUrVw2prjsGuKla15LPRVnSv6G"

By the way, you need to enclose the URL with single or double quotes. See this FAQ entry

@KwToPA
Copy link
Author

@KwToPA KwToPA commented Apr 21, 2016

Sorry, my mistake. I pressed control+c

proxychains4 youtube-dl -v --playlist-items 3-6 -f bestvideo+bestaudio --external-downloader aria2c "https://www.youtube.com/watch?v=WAmtH91S2GQ&list=PLwXMmy5fUrVw2prjsGuKla15LPRVnSv6G"
[proxychains] config file found: /usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.7/lib/libproxychains4.dylib
[proxychains] DLL init
[proxychains] DLL init
[proxychains] DLL init
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'--playlist-items', u'3-6', u'-f', u'bestvideo+bestaudio', u'--external-downloader', u'aria2c', u'https://www.youtube.com/watch?v=WAmtH91S2GQ&list=PLwXMmy5fUrVw2prjsGuKla15LPRVnSv6G']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.04.19
[proxychains] DLL init
[debug] Python version 2.7.6 - Darwin-14.5.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.0.1-tessus
[debug] Proxy map: {}
[youtube:playlist] Downloading playlist PLwXMmy5fUrVw2prjsGuKla15LPRVnSv6G - add --no-playlist to just download video WAmtH91S2GQ
[youtube:playlist] PLwXMmy5fUrVw2prjsGuKla15LPRVnSv6G: Downloading webpage
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  www.youtube.com:443  ...  OK
[download] Downloading playlist: 【CCTV《高考》】一场影响亿万中国人命运的考试【全六集1080P】
[youtube:playlist] playlist 【CCTV《高考》】一场影响亿万中国人命运的考试【全六集1080P】: Downloading 4 videos
[download] Downloading video 1 of 4
[youtube] drpjOEGPNNs: Downloading webpage
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  www.youtube.com:443  ...  OK
[youtube] drpjOEGPNNs: Downloading video info webpage
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  www.youtube.com:443  ...  OK
[youtube] drpjOEGPNNs: Extracting video information
[youtube] drpjOEGPNNs: Downloading MPD manifest
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  manifest.googlevideo.com:443  ...  OK
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on u'https://r3---sn-ogueln7y.googlevideo.com/videoplayback?id=76ba6338418f34db&itag=137&source=youtube&requiressl=yes&mn=sn-ogueln7y&mm=31&nh=IgpwcjAyLm5ydDE5KgkxMjcuMC4wLjE&ms=au&mv=m&pl=23&initcwndbps=4103750&ratebypass=yes&mime=video/mp4&gir=yes&clen=799802624&lmt=1440345420317372&dur=2965.960&key=dg_yt0&sver=3&fexp=9415327,9416126,9416891,9420452,9422596,9426927,9428326,9428398,9431012,9431045,9431132,9432028,9433095,9433097,9433188,9433223,9433276,9433424,9434210,9434767,9434922&signature=36E44C86D77AE752B01CD8B15D7A6CF2547A3B1B.9ADCEC4AA5CCD46E2783A647E626224292A31722&mt=1461240656&upn=pMjwj3GMpjE&ip=106.187.54.22&ipbits=0&expire=1461262338&sparams=ip,ipbits,expire,id,itag,source,requiressl,mn,mm,nh,ms,mv,pl,initcwndbps,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: 高考 第三集 久牵的孩子们-drpjOEGPNNs.f137.mp4
[debug] aria2c command line: aria2c -c --min-split-size 1M --max-connection-per-server 4 --out '高考 第三集 久牵的孩子们-drpjOEGPNNs.f137.mp4.part' --header 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7' --header 'Accept-Language: en-us,en;q=0.5' --header 'Accept-Encoding: gzip, deflate' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/44.0 (Chrome)' --check-certificate=true -- 'https://r3---sn-ogueln7y.googlevideo.com/videoplayback?id=76ba6338418f34db&itag=137&source=youtube&requiressl=yes&mn=sn-ogueln7y&mm=31&nh=IgpwcjAyLm5ydDE5KgkxMjcuMC4wLjE&ms=au&mv=m&pl=23&initcwndbps=4103750&ratebypass=yes&mime=video/mp4&gir=yes&clen=799802624&lmt=1440345420317372&dur=2965.960&key=dg_yt0&sver=3&fexp=9415327,9416126,9416891,9420452,9422596,9426927,9428326,9428398,9431012,9431045,9431132,9432028,9433095,9433097,9433188,9433223,9433276,9433424,9434210,9434767,9434922&signature=36E44C86D77AE752B01CD8B15D7A6CF2547A3B1B.9ADCEC4AA5CCD46E2783A647E626224292A31722&mt=1461240656&upn=pMjwj3GMpjE&ip=106.187.54.22&ipbits=0&expire=1461262338&sparams=ip,ipbits,expire,id,itag,source,requiressl,mn,mm,nh,ms,mv,pl,initcwndbps,ratebypass,mime,gir,clen,lmt,dur'

04/21 20:12:22 [NOTICE] Allocating disk space. Use --file-allocation=none to disable it. See --file-allocation option in man page for more details.
[#9e151d 5.1MiB/762MiB(0%) CN:4 DL:710KiB ETA:18m12s]^C                        
ERROR: Interrupted by user

04/21 20:12:33 [NOTICE] Shutdown sequence commencing... Press Ctrl-C again for emergency shutdown.

04/21 20:12:33 [NOTICE] Download GID#9e151de034640f4f not complete: /Users/chenbruce/高考 第三集 久牵的孩子们-drpjOEGPNNs.f137.mp4.part

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
9e151d|INPR|   672KiB/s|/Users/chenbruce/高考 第三集 久牵的孩子们-drpjOEGPNNs.f137.mp4.part

Status Legend:
(INPR):download in-progress.

aria2 will resume download if the transfer is restarted.
If there are any errors, then see the log file. See '-l' option in help/man page for details.
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 21, 2016

Seems it's working now. Don't forget to restore youtube_dl/__init__.py.

@yan12125 yan12125 closed this Apr 21, 2016
@KwToPA
Copy link
Author

@KwToPA KwToPA commented Apr 21, 2016

Thanks for your help, but I put it back

    except KeyboardInterrupt:
        sys.exit('\nERROR: Interrupted by user')

before I use command

proxychains4 youtube-dl -v --playlist-items 3-6 -f bestvideo+bestaudio --external-downloader aria2c "https://www.youtube.com/watch?v=WAmtH91S2GQ&list=PLwXMmy5fUrVw2prjsGuKla15LPRVnSv6G"
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 21, 2016

Removing the two lines is for dumping the stack trace when something is stuck. Now it's not necessary.

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
2 participants
You can’t perform that action at this time.