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

While downloading a bandcamp album: ValueError: unknown url type: '' #4861

Closed
Ezwen opened this issue Feb 4, 2015 · 12 comments
Closed

While downloading a bandcamp album: ValueError: unknown url type: '' #4861

Ezwen opened this issue Feb 4, 2015 · 12 comments

Comments

@Ezwen
Copy link

@Ezwen Ezwen commented Feb 4, 2015

Hello!

I encountered the following error while downloading the album of this page : http://sabrepulse.bandcamp.com/album/blood-eagle

Here is the complete trace:

xxx@yyy zzz$ youtube-dl --verbose -o "%(autonumber)s - %(title)s.%(ext)s" --autonumber-size 2 --audio-format vorbis --recode-video ogg http://sabrepulse.bandcamp.com/album/blood-eagle
[debug] System config: ['--prefer-free-formats']
[debug] User config: []
[debug] Command-line args: ['--verbose', '-o', '%(autonumber)s - %(title)s.%(ext)s', '--autonumber-size', '2', '--audio-format', 'vorbis', '--recode-video', 'ogg', 'http://sabrepulse.bandcamp.com/album/blood-eagle']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.01.25
[debug] Python version 2.7.8 - Linux-3.18.3-201.fc21.x86_64-x86_64-with-fedora-21-Twenty_One
[debug] exe versions: ffmpeg 2.4.6, ffprobe 2.4.6, rtmpdump 2.4
[debug] Proxy map: {}
[Bandcamp:album] blood-eagle: Downloading webpage
[download] Downloading playlist: Blood Eagle
[Bandcamp:album] playlist Blood Eagle: Collected 9 video ids (downloading 9 of them)
[download] Downloading video 1 of 9
[Bandcamp] here-is-to-forever: Downloading webpage
[debug] Invoking downloader on u'http://popplers5.bandcamp.com/download/track?enc=mp3-128&fsig=455b4dce2a43eb02124f59584470b0d3&id=638852592&stream=1&ts=1422991916.0'
[download] Destination: 01 - Here Is To Forever.mp3
[download] 100% of 2.80MiB in 00:37
[ffmpeg] Converting video from mp3 to ogg, Destination: 01 - Here Is To Forever.ogg
[debug] ffmpeg command line: ffmpeg -y -i '01 - Here Is To Forever.mp3' '01 - Here Is To Forever.ogg'
Deleting original file 01 - Here Is To Forever.mp3 (pass -k to keep)
[download] Downloading video 2 of 9
[Bandcamp] cart-killa: Downloading webpage
[debug] Invoking downloader on u'http://popplers5.bandcamp.com/download/track?enc=mp3-128&fsig=c73f4047510b97289cb1bf406ec76bb4&id=2559789548&stream=1&ts=1422965551.0'
[download] Destination: 02 - Cart Killa.mp3
[download] 100% of 3.57MiB in 00:53
[ffmpeg] Converting video from mp3 to ogg, Destination: 02 - Cart Killa.ogg
[debug] ffmpeg command line: ffmpeg -y -i '02 - Cart Killa.mp3' '02 - Cart Killa.ogg'
Deleting original file 02 - Cart Killa.mp3 (pass -k to keep)
[download] Downloading video 3 of 9
[Bandcamp] blood-eagle: Downloading webpage
[Bandcamp] 1724097254: Downloading free downloads page
[Bandcamp] 1724097254: Requesting download url
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 6, in <module>
    youtube_dl.main()
  File "/usr/lib/python2.7/site-packages/youtube_dl/__init__.py", line 380, in main
    _real_main(argv)
  File "/usr/lib/python2.7/site-packages/youtube_dl/__init__.py", line 370, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1346, in download
    res = self.extract_info(url)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 624, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 783, in process_ie_result
    extra_info=extra)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 677, in process_ie_result
    extra_info=extra_info)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 624, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 670, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1016, in process_video_result
    format['http_headers'] = self._calc_headers(full_format_info)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 910, in _calc_headers
    cookies = self._calc_cookies(info_dict)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 936, in _calc_cookies
    self.cookiejar.add_cookie_header(pr)
  File "/usr/lib64/python2.7/cookielib.py", line 1324, in add_cookie_header
    cookies = self._cookies_for_request(request)
  File "/usr/lib64/python2.7/cookielib.py", line 1250, in _cookies_for_request
    cookies.extend(self._cookies_for_domain(domain, request))
  File "/usr/lib64/python2.7/cookielib.py", line 1230, in _cookies_for_domain
    if not self._policy.domain_return_ok(domain, request):
  File "/usr/lib64/python2.7/cookielib.py", line 1147, in domain_return_ok
    req_host, erhn = eff_request_host(request)
  File "/usr/lib64/python2.7/cookielib.py", line 604, in eff_request_host
    erhn = req_host = request_host(request)
  File "/usr/lib64/python2.7/cookielib.py", line 592, in request_host
    host = request.get_header("Host", "")
AttributeError: '_PseudoRequest' object has no attribute 'get_header'
@phihag
Copy link
Contributor

@phihag phihag commented Feb 9, 2015

Can you reproduce this issue with the current version of youtube-dl (2015.02.08)? See our FAQ if you need help updating.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Feb 9, 2015

I fixed the problem with the _PseudoRequest object, the real issue is that we get an empty url for that track:

$youtube-dl 'http://sabrepulse.bandcamp.com/album/blood-eagle' -j | jq .url
"http://popplers5.bandcamp.com/download/track?..."
"http://popplers5.bandcamp.com/download/track?..."
""
"http://popplers5.bandcamp.com/download/track?..."
"http://popplers5.bandcamp.com/download/track?..."
"http://popplers5.bandcamp.com/download/track?..."
"http://popplers5.bandcamp.com/download/track?..."
"http://popplers5.bandcamp.com/download/track?..."
"http://popplers5.bandcamp.com/download/track?..."
@Ezwen
Copy link
Author

@Ezwen Ezwen commented Feb 10, 2015

Unfortunately I still encounter an error with the latest version vailable on Arch (2015.02.09.3), which is a "ValueError: unknown url type: ''". Here are the logs:

[xxx@yyy zzz]$ youtube-dl --verbose -o "%(autonumber)s - %(title)s.%(ext)s" --autonumber-size 2 --audio-format vorbis --recode-video ogg http://sabrepulse.bandcamp.com/album/blood-eagle
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', '-o', '%(autonumber)s - %(title)s.%(ext)s', '--autonumber-size', '2', '--audio-format', 'vorbis', '--recode-video', 'ogg', 'http://sabrepulse.bandcamp.com/album/blood-eagle']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.02.09.3
[debug] Python version 3.4.2 - Linux-3.18.6-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 2.5.3, ffprobe 2.5.3, rtmpdump 2.4
[debug] Proxy map: {}
[Bandcamp:album] blood-eagle: Downloading webpage
[download] Downloading playlist: Blood Eagle
[Bandcamp:album] playlist Blood Eagle: Collected 9 video ids (downloading 9 of them)
[download] Downloading video 1 of 9
[Bandcamp] here-is-to-forever: Downloading webpage
[debug] Invoking downloader on 'http://popplers5.bandcamp.com/download/track?enc=mp3-128&fsig=2b22f24be69d721fe830c4550dde2117&id=638852592&stream=1&ts=1423559741.0'
[download] Destination: 01 - Here Is To Forever.mp3
[download] 100% of 2.80MiB in 00:38
[ffmpeg] Converting video from mp3 to ogg, Destination: 01 - Here Is To Forever.ogg
[debug] ffmpeg command line: ffmpeg -y -i '01 - Here Is To Forever.mp3' '01 - Here Is To Forever.ogg'
Deleting original file 01 - Here Is To Forever.mp3 (pass -k to keep)
[download] Downloading video 2 of 9
[Bandcamp] cart-killa: Downloading webpage
[debug] Invoking downloader on 'http://popplers5.bandcamp.com/download/track?enc=mp3-128&fsig=7fef0bc79d2d0e9749aa909c2da68c06&id=2559789548&stream=1&ts=1423570074.0'
[download] Destination: 02 - Cart Killa.mp3
[download] 100% of 3.57MiB in 00:53
[ffmpeg] Converting video from mp3 to ogg, Destination: 02 - Cart Killa.ogg
[debug] ffmpeg command line: ffmpeg -y -i '02 - Cart Killa.mp3' '02 - Cart Killa.ogg'
Deleting original file 02 - Cart Killa.mp3 (pass -k to keep)
[download] Downloading video 3 of 9
[Bandcamp] blood-eagle: Downloading webpage
[Bandcamp] 1724097254: Downloading free downloads page
[Bandcamp] 1724097254: Requesting download url
[debug] Invoking downloader on ''
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 9, in <module>
    load_entry_point('youtube-dl==2015.2.9.3', 'console_scripts', 'youtube-dl')()
  File "/usr/lib/python3.4/site-packages/youtube_dl/__init__.py", line 382, in main
    _real_main(argv)
  File "/usr/lib/python3.4/site-packages/youtube_dl/__init__.py", line 372, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1373, in download
    res = self.extract_info(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 630, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 789, in process_ie_result
    extra_info=extra)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 683, in process_ie_result
    extra_info=extra_info)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 630, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 676, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1131, in process_video_result
    self.process_info(new_info)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1306, in process_info
    success = dl(filename, info_dict)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1281, in dl
    return fd.download(name, info)
  File "/usr/lib/python3.4/site-packages/youtube_dl/downloader/common.py", line 316, in download
    return self.real_download(filename, info_dict)
  File "/usr/lib/python3.4/site-packages/youtube_dl/downloader/http.py", line 35, in real_download
    basic_request = compat_urllib_request.Request(url, data, headers)
  File "/usr/lib/python3.4/urllib/request.py", line 258, in __init__
    self.full_url = url
  File "/usr/lib/python3.4/urllib/request.py", line 284, in full_url
    self._parse()
  File "/usr/lib/python3.4/urllib/request.py", line 313, in _parse
    raise ValueError("unknown url type: %r" % self.full_url)
ValueError: unknown url type: ''
[xxx@yyy zzz]$ youtube-dl --version
2015.02.09.3
@jaimeMF jaimeMF changed the title While downloading a bandcamp album: "AttributeError: '_PseudoRequest' object has no attribute 'get_header'" While downloading a bandcamp album: ValueError: unknown url type: '' Feb 10, 2015
@mufasa71
Copy link

@mufasa71 mufasa71 commented Feb 17, 2015

I also reproduce this error, anybody know how to get rid of this?

@orbea
Copy link

@orbea orbea commented Mar 24, 2015

I seem to be getting this issue too, but only with certain artists.

$ youtube-dl http://duskydiva.bandcamp.com/album/didymus-lace
[Bandcamp:album] didymus-lace: Downloading webpage
[download] Downloading playlist: Didymus Lace
[Bandcamp:album] playlist Didymus Lace: Collected 5 video ids (downloading 5 of them)
[download] Downloading video 1 of 5
[Bandcamp] timothys-serpent: Downloading webpage
[Bandcamp] 1810424803: Downloading free downloads page
[Bandcamp] 1810424803: Requesting download url
Traceback (most recent call last):
File "/usr/bin/youtube-dl", line 6, in
youtube_dl.main()
File "/usr/lib64/python2.7/site-packages/youtube_dl/init.py", line 408, in main
_real_main(argv)
File "/usr/lib64/python2.7/site-packages/youtube_dl/init.py", line 398, in _real_main
retcode = ydl.download(all_urls)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1452, in download
res = self.extract_info(url)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 665, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 824, in process_ie_result
extra_info=extra)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 718, in process_ie_result
extra_info=extra_info)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 665, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 711, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1153, in process_video_result
self.process_info(new_info)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1385, in process_info
success = dl(filename, info_dict)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1360, in dl
return fd.download(name, info)
File "/usr/lib64/python2.7/site-packages/youtube_dl/downloader/common.py", line 341, in download
return self.real_download(filename, info_dict)
File "/usr/lib64/python2.7/site-packages/youtube_dl/downloader/http.py", line 64, in real_download
data = self.ydl.urlopen(request)
File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1679, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib64/python2.7/urllib2.py", line 396, in open
protocol = req.get_type()
File "/usr/lib64/python2.7/urllib2.py", line 258, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type:


And by extension I can not play certain bandcamp links with mpv

$ mpv http://duskydiva.bandcamp.com/album/didymus-lace
Playing: http://duskydiva.bandcamp.com/album/didymus-lace

Playing: ytdl://http://duskydiva.bandcamp.com/track/timothys-serpent
[file] Cannot open file '': No such file or directory
Failed to open .


$ youtube-dl --version
2015.03.18

Here is an obviously partial list of affected artists, most bandcamp links seem to work.
http://soffmimuhod.bandcamp.com/
http://ryverdyak.bandcamp.com/
http://duskydiva.bandcamp.com/album/ex-libris
http://prypiat.bandcamp.com/
http://lenzisk.bandcamp.com/album/lenzisk
http://andrewmackelvie.bandcamp.com/album/live-1313-mackelvie-jackson-shimeld-thompson
http://robbelleville.bandcamp.com/album/free-tracks
http://errolegerson.bandcamp.com/album/fantasy

It seems this mostly if not only affects links with free or "name your price" music which it has done so for every single one I have tried excluding the following.
http://souterraine.biz/album/degrad-mostlatape

There might be exceptions, but it seems to work with all non-free links I have tried so far.

@orbea
Copy link

@orbea orbea commented Mar 24, 2015

Here is one more free link that works:
http://soffmimuhod.bandcamp.com/album/qeccka-kyheb-v-03

However I know that Soffmi Muhod album was also released as non-free initially and was made free only later while most if not all of the others were free from the start.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Apr 20, 2015

It will work in the next version (thanks to @quinq). Thanks for the report.

@Ezwen
Copy link
Author

@Ezwen Ezwen commented Apr 25, 2015

Many many thanks for this fix.

@quinq
Copy link

@quinq quinq commented Apr 25, 2015

You're welcome, I needed it to work. ;)
Thanks for youtube-dl!

@Digit
Copy link

@Digit Digit commented Apr 26, 2015

I got the impression from the pattern I observed iirc that it was albums/tracks uploaded to bandcamp as flac had this issue*, and tracks uploaded as wav were fine.

*i think

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 26, 2015

This has been fixed in youtube-dl 2015.04.26. See our FAQ if you have problems updating.

@orbea
Copy link

@orbea orbea commented Apr 27, 2015

I updated youtube-dl on slackware-current and tried a few links I pasted earlier, it seems fixed. Thanks for the hard work!

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.

8 participants
You can’t perform that action at this time.