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

Slash (/) in video title causes application to lock up #3885

Closed
m42uko opened this issue Oct 5, 2014 · 5 comments
Closed

Slash (/) in video title causes application to lock up #3885

m42uko opened this issue Oct 5, 2014 · 5 comments

Comments

@m42uko
Copy link

@m42uko m42uko commented Oct 5, 2014

When trying to download a video with an illegal character in the title such as a "/", youtube-dl locks up.

Example: youtube-dl "https://www.youtube.com/watch?v=lFSFdkXMOZo" with the title "Myself ; Yourself Ending Song (ENGLISH & JAPANESE LYRICS) |HD/HQ|"

Using "--restrict-filenames" does not solve the problem. However, getting the path with -g and downloading the video using an external program works.

Possible solution: Replace a / with an _.

youtube-dl -v "https://www.youtube.com/watch?v=lFSFdkXMOZo"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=lFSFdkXMOZo']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.10.05
[debug] Python version 2.7.6 - Linux-3.13.0-36-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] Proxy map: {}
[youtube] Setting language
[youtube] Confirming age
[youtube] lFSFdkXMOZo: Downloading webpage
[youtube] lFSFdkXMOZo: Downloading video info webpage
[youtube] lFSFdkXMOZo: Extracting video information
[debug] Invoking downloader on u'https://r5---sn-35cxacf-nuge.googlevideo.com/[...]'
@phihag
Copy link
Contributor

@phihag phihag commented Oct 5, 2014

We already do replace slashes; and it works fine for me:

youtube-dl -v "https://www.youtube.com/watch?v=lFSFdkXMOZo"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=lFSFdkXMOZo']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.10.05
[debug] Python version 2.7.6 - Linux-3.13.0-36-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] Proxy map: {}
[youtube] Setting language
[youtube] Confirming age
[youtube] lFSFdkXMOZo: Downloading webpage
[youtube] lFSFdkXMOZo: Downloading video info webpage
[youtube] lFSFdkXMOZo: Extracting video information
[debug] Invoking downloader on u'https://r1---sn-p5qlsn7l.googlevideo.com/videoplayback?ms=au&mt=1412537580&fexp=914095%2C916603%2C924639%2C927622%2C929305%2C930666%2C93'
[download] Destination: Myself ; Yourself Ending Song (ENGLISH & JAPANESE LYRICS) _HD_HQ-lFSFdkXMOZo.mp4
[download] 100% of 12.81MiB in 00:00

Can you elaborate what "locks up" means? Do you see 100% CPU usage? What do you see if you attach strace or ltrace to the youtube-dl process?

@m42uko
Copy link
Author

@m42uko m42uko commented Oct 5, 2014

I just simply let it run for a while and after a few minutes it downloaded the video just fine. However, this seems to happen with every file right now.

It gets to "Extracting video information", hangs there for around 3 to 5 minutes (0% load), then it downloads (at normal speed).

Sorry for all the confusion. I don't know whether this is a problem with my setup or whether it's a problem with youtube-dl.

Some more info:

  • I use IPv6
  • I first noticed the issue yesterday (first use of youtube dl on this machine)
  • It does not happen if the video has already been downloaded (immediate skip)
  • It works fine on my server (IPv4), will try different systems tomorrow.
  • This is a pure 64 bit system (no 32 bit libs)

This is what I wrote before I noticed it: Maybe it's still helpful.
Okay that's weird... By lock up I mean it does simply stop doing anything, CPU usage at 0%.

Here's the output of strace:

[...]
write(1, "[debug] Invoking downloader on u"..., 711[debug] Invoking downloader on u'https://r5---sn-35cxacf-nuge.googlevideo.com/videoplayback?mv=m&source=youtube&ratebypass=yes&signature=BBFBEA3F698072B4B900429E37F7505B334D51EE.1E3D2A8776AFB17C408CBBCB035D07451A69D86A&ms=au&mt=1412538408&initcwndbps=2431250&upn=GJZ8kcZLXcA&requiressl=yes&mm=31&ip=2a02%3A8070%3A5c3%3A5900%3A45e1%3A1cc2%3Ac149%3A6e88&expire=1412560114&key=yt5&id=o-AOoY2MMBkxqjEsqql2AS-dscGNSjhExyCzaVLFINWkzt&fexp=912115%2C915516%2C924638%2C927622%2C930666%2C931983%2C932404%2C934030%2C935660%2C938628%2C939969%2C945241%2C946023%2C947209%2C952302%2C953801&sparams=id%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmm%2Cms%2Cmv%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&itag=22&ipbits=0&sver=3'
) = 711
stat("Myself ; Yourself Ending Song (ENGLISH & JAPANESE LYRICS) _HD_HQ-lFSFdkXMOZo.mp4", 0x7fff1c2ee2d0) = -1 ENOENT (No such file or directory)
stat("Myself ; Yourself Ending Song (ENGLISH & JAPANESE LYRICS) _HD_HQ-lFSFdkXMOZo.mp4", 0x7fff1c2edfb0) = -1 ENOENT (No such file or directory)
stat("Myself ; Yourself Ending Song (ENGLISH & JAPANESE LYRICS) _HD_HQ-lFSFdkXMOZo.mp4.part", 0x7fff1c2ee0f0) = -1 ENOENT (No such file or directory)
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=199, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd21db72000
read(3, "127.0.0.1\tlocalhost\n127.0.1.1\tB7"..., 4096) = 199
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7fd21db72000, 4096)            = 0
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.1.1")}, 16) = 0
poll([{fd=3, events=POLLOUT}], 1, 0)    = 1 ([{fd=3, revents=POLLOUT}])
sendmmsg(3, {{{msg_name(0)=NULL, msg_iov(1)=[{"_[\1\0\0\1\0\0\0\0\0\0\24r5---sn-35cxacf-nug"..., 54}], msg_controllen=0, msg_flags=MSG_WAITALL|MSG_FIN|MSG_NOSIGNAL|MSG_MORE|0x1c2e0000}, 54}, {{msg_name(0)=NULL, msg_iov(1)=[{"\320u\1\0\0\1\0\0\0\0\0\0\24r5---sn-35cxacf-nug"..., 54}], msg_controllen=0, msg_flags=MSG_TRUNC|MSG_DONTWAIT|MSG_EOR|MSG_FIN|MSG_NOSIGNAL|MSG_MORE|0x1c2e0010}, 54}}, 2, MSG_NOSIGNAL) = 2
poll([{fd=3, events=POLLIN}], 1, 5000)  = 1 ([{fd=3, revents=POLLIN}])
ioctl(3, FIONREAD, [103])               = 0
recvfrom(3, "_[\201\200\0\1\0\2\0\0\0\0\24r5---sn-35cxacf-nug"..., 2048, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.1.1")}, [16]) = 103
poll([{fd=3, events=POLLIN}], 1, 4998)  = 1 ([{fd=3, revents=POLLIN}])
ioctl(3, FIONREAD, [115])               = 0
recvfrom(3, "\320u\201\200\0\1\0\2\0\0\0\0\24r5---sn-35cxacf-nug"..., 1945, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.1.1")}, [16]) = 115
close(3)                                = 0
socket(PF_NETLINK, SOCK_RAW, 0)         = 3
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=11265, groups=00000000}, [12]) = 0
sendto(3, "\24\0\0\0\26\0\1\3\223\2401T\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"D\0\0\0\24\0\2\0\223\2401T\1,\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 148
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"@\0\0\0\24\0\2\0\223\2401T\1,\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 256
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\223\2401T\1,\0\0\0\0\0\0", 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(3)                                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("109.193.192.16")}, 16) = 0
getsockname(3, {sa_family=AF_INET, sin_port=htons(35182), sin_addr=inet_addr("192.168.178.149")}, [16]) = 0
close(3)                                = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET6, sin6_port=htons(443), inet_pton(AF_INET6, "2a02:8070:0:801::10", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
getsockname(3, {sa_family=AF_INET6, sin6_port=htons(35500), inet_pton(AF_INET6, "2a02:8070:5c3:5900:45e1:1cc2:c149:6e88", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 0
close(3)                                = 0
socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = 3
fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
connect(3, {sa_family=AF_INET6, sin6_port=htons(443), inet_pton(AF_INET6, "2a02:8070:0:801::10", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EINPROGRESS (Operation now in progress)
poll([{fd=3, events=POLLOUT}], 1, 600000

Nothing after that. Do you also need the beginning of the log?

@phihag
Copy link
Contributor

@phihag phihag commented Oct 5, 2014

Thanks for the detailed information! It's nice to get detailed error reports for once.

It looks like r1---sn-p5qlsn7l.googlevideo.com resolves to 2a02:8070:0:801::10 for you (this seems to be a caching server on Kabel BW's premises). However, 2a02:8070:0:801::10 does not answer to SSL. Unfortunately, there doesn't seem to be anything routing to or from 2a02:8070:0:801::10 (or the box is simply dead for some reason).

If you pass in --socket-timeout 5, does it work after 5 seconds for you? youtube-dl will then pick the next available host.

@m42uko
Copy link
Author

@m42uko m42uko commented Oct 6, 2014

Yes, passing --socket-timeout 5 does help. So it really seems to be an issue with the IPv6-server.

When I use wget on the video path I have to enforce IPv4 (-4) for it to work. Is there a way to force youtube-dl to use IPv4 - as this would be a temporary fix until the server is back.

Thank you for your help!

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 26, 2015

@cclassic latest youtube-dl veresions support the --force-ipv4 option (but it's still experimental).

@dstftw dstftw closed this Jun 2, 2016
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
4 participants
You can’t perform that action at this time.