youtube-dl
youtube-dl copied to clipboard
[netease] IPs outside mainland China may access via CDNs.
Please follow the guide below
- You will be asked some questions, please read them carefully and answer honestly
- Put an
x
into all the boxes [ ] relevant to your pull request (like that [x]) - Use Preview tab to see how your pull request will actually look like
Before submitting a pull request make sure you have:
- [x] At least skimmed through adding new extractor tutorial and youtube-dl coding conventions sections
- [x] Searched the bugtracker for similar pull requests
What is the purpose of your pull request?
- [x] Bug fix
- [ ] New extractor
- [ ] New feature
Description of your pull request and other information
Like #7514, this commit makes downloading mp3 from netease possible again, by using hostnames that resolve to CNAMEs on CDN.
Should I revert 75af5d59ae5c4c6549cce5357a8a8d060c3f462c to enable the tests?
This does not seem to work at all:
PS C:\dev\youtube-dl\master> py -3.5 .\youtube_dl\__main__.py http://music.163.com/#/song?id=32102397 -F -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['http://music.163.com/#/song?id=32102397', '-F', '-v']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2016.08.22
[debug] Git HEAD: 1b79c19
[debug] Python version 3.5.2 - Windows-10-10.0.10240-SP0
[debug] exe versions: ffmpeg N-81192-g04da20e, ffprobe N-81192-g04da20e, rtmpdump 2.4
[debug] Proxy map: {}
[netease:song] 32102397: Downloading song info
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "C:\dev\youtube-dl\master\youtube_dl\YoutubeDL.py", line 691, in extract_info
ie_result = ie.extract(url)
File "C:\dev\youtube-dl\master\youtube_dl\extractor\common.py", line 347, in extract
return self._real_extract(url)
File "C:\dev\youtube-dl\master\youtube_dl\extractor\neteasemusic.py", line 165, in _real_extract
self._sort_formats(formats)
File "C:\dev\youtube-dl\master\youtube_dl\extractor\common.py", line 911, in _sort_formats
raise ExtractorError('No video formats found')
youtube_dl.utils.ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
@dstftw Thanks for your quick response. I have fixed xrange
.
Yea your case fails on my end too.
But it seems that http://music.163.com/#/song?id=32102397
is a piece of music behind paywall, thus it doesn't surprise me when http://music.163.com/api/song/detail?ids=[32102397]
returns me None
for the key ['songs'][0]['mp3Url']
. I can't make magic out of that.
My (smoke) test cases (done on zsh) were:
- http://music.163.com/#/album?id=3317645
- http://music.163.com/#/song?id=423406359
% ./youtube-dl -g -v 'http://music.163.com/#/album?id=3317645'
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-g', u'-v', u'http://music.163.com/#/album?id=3317645']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.08.22
[debug] Git HEAD: 7e5bfbd
[debug] Python version 2.7.12 - Darwin-15.6.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
http://p1.music.126.net/HbWL3hxnYMKsEwPqN1wWeg==/3400789465465085.mp3
http://p1.music.126.net/dtgUV2t3ffUTSBWYak1DNg==/3439272372597256.mp3
http://p1.music.126.net/kbHQQA3ngnCKkazNCoB6ww==/3412884093377037.mp3
http://p1.music.126.net/FyOC4qJVrJTWw034Xd1Jtw==/3400789465465086.mp3
http://p1.music.126.net/zJGxpm3OHPRnhR1w5kXjmQ==/3439272372597257.mp3
http://p1.music.126.net/LoWCjWsH2cqJbzFNwNz2Vw==/3412884093377038.mp3
http://p1.music.126.net/sVbWmLwhv_iokLSDsg14Bw==/3344714372967401.mp3
http://p1.music.126.net/hghicqYjXZ7fMBQxRGXTlA==/3417282140081837.mp3
http://p1.music.126.net/CnNt1BqUPVYqOg9d3quNVQ==/3412884093377039.mp3
http://p1.music.126.net/lLltn-q9_7t4R5z4vilZyA==/3344714372967402.mp3
http://p1.music.126.net/zLOTdB_UCy7ShUyGMg4ctw==/3424978721364014.mp3
http://p1.music.126.net/vGG0mj9m-LHUvj6tCUCsuw==/3439272372597259.mp3
% ./youtube-dl -g -v 'http://music.163.com/#/song?id=423406359'
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-g', u'-v', u'http://music.163.com/#/song?id=423406359']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.08.22
[debug] Git HEAD: 7e5bfbd
[debug] Python version 2.7.12 - Darwin-15.6.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
http://p1.music.126.net/Sa6Os979UU5uCO6kCK0umg==/3265549572123018.mp3
And yes, I am actually able to download them.
Could you try some free ones?
Regards, Jialong
Test should be revisited and skip
removed for those that work with this approach.
Squash commits when done.
Per code of you-get
, adding '/'.join(info.get('mp3Url').split('/')[0:3])
and "http://p{}".format(info.get('mp3Url').split('/')[2][1:])
to hosts list might help.
Need more feedbacks, so no new Pull Request atm.
standard access:
- needed params & enseckey
1- generate random 16 bytes key from "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
2- params:
$params=base64_encode(encryptaes128(\''.$json.'\',"0CoJUm6Qyw8W8jud"));
$params=urlencode(base64_encode(encryptaes128($params,"'.$key .'")));
iv="0102030405060708"
needed padding
2- enseckey is rsa: - modulus 00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462db0a22b8e7 -exponent starndard 010001
-encrypt key