Giter VIP home page Giter VIP logo

ykdl's Introduction

YouKuDownLoader

A video downloader focus on China mainland video sites.

Origin website: https://github.com/zhangn1985/ykdl

Now, it has migrated to the new website: https://github.com/SeaHOH/ykdl

And, it is still looking for a new owner, see #565.

This project is a fork of you-get with below changes.

  • Structured source code.
  • Focus on China mainland video sites.
  • Dropped supports of Python 3.4 and below (see #487).

Simple installation guide

There are some useful software package managers.

Step:
  1. Dependencies

    FFmpeg, for merge media files.
    mpv, default media player (optimal compatibility).
  2. Python 3

  3. pip and setuptools, make sure they are updated.

    python3 -m ensurepip
    python3 -m pip install pip --upgrade
    python3 -m pip install setuptools --upgrade
  4. ykdl from PyPI or GitHub

    pip3 install ykdl --upgrade
    pip3 install https://github.com/SeaHOH/ykdl/archive/master.zip --force-reinstall --no-deps
    pip3 install https://github.com/SeaHOH/ykdl/archive/master.zip --upgrade
  5. Make sure those folders are in your PATH, if they are not, add them.

    Windows: folders of ffmpeg.exe, mpv.exe, and python.exe, and folder "<PYTHONHOME>\Scripts"
    others: "~/.local/bin" or "/usr/local/bin"

Site status

Please check wiki page: sites-status

Bugs report, features require, and pull requests are welcome.

ykdl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ykdl's Issues

iqiyi下载出错

这两天下载iqiyi视频时会报错。
输入:ykdl http://www.iqiyi.com/v_19rrlyanb8.html
返回的是:
Traceback (most recent call last):
File "c:\program files (x86)\python35\lib\runpy.py", line 184, in run_module
as_main
"main", mod_spec)
File "c:\program files (x86)\python35\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python35\Scripts\ykdl.exe__main
_.py", line 9, i
n
File "c:\program files (x86)\python35\lib\site-packages\ykdl__main__.py", lin
e 119, in main
info = parser(u)
File "c:\program files (x86)\python35\lib\site-packages\ykdl\extractor.py", li
ne 19, in parser
info = self.prepare()
File "c:\program files (x86)\python35\lib\site-packages\ykdl\extractors\iqiyi.
py", line 78, in prepare
assert data['bossStatus'] == 0, "%s: can't download VIP videos!" % self.name

KeyError: 'bossStatus'

pip安装的最新版没法用

python -m ykdl -i http://www.iqiyi.com/v_19rr9h0t5g.html
D:\PortableApps\Python\python.exe: No module named ykdl.__main__; 'ykdl' is a package and cannot be directly executed

panda tv,解析有问题

我就随手试了下,发现就这个有问题

ykdl -i http://www.panda.tv/13653
site:                熊猫TV (Panda)
Traceback (most recent call last):
  File "D:\PortableApps\Python\lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\PortableApps\Python\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\PortableApps\Python\lib\site-packages\ykdl\__main__.py", line 148, in <module>
    main()
  File "D:\PortableApps\Python\lib\site-packages\ykdl\__main__.py", line 136, in main
    handle_videoinfo(info)
  File "D:\PortableApps\Python\lib\site-packages\ykdl\__main__.py", line 77, in handle_videoinfo
    info.print_info(args.format, args.info)
  File "D:\PortableApps\Python\lib\site-packages\ykdl\videoinfo.py", line 47, in print_info
    print("title:               %s" % self.title)
UnicodeEncodeError: 'gbk' codec can't encode character '\u265b' in position 22: illegal multibyte sequence

mgtv is broken!

bin/ykdl.py -i http://www.mgtv.com/v/2/293140/c/3269011.html
Traceback (most recent call last):
  File "bin/ykdl.py", line 148, in <module>
    main()
  File "bin/ykdl.py", line 127, in main
    info = parser(u)
  File "/home/zhangn1985/source/ykdl/ykdl/extractor.py", line 19, in parser
    info = self.prepare()
  File "/home/zhangn1985/source/ykdl/ykdl/extractors/mgtv.py", line 26, in prepare
    meta = json.loads(get_content(api_url))
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
video.mk:78: recipe for target 'test_mgtv' failed
make: *** [test_mgtv] Error 1

寻一名合作伙伴| looking for Collaborators, deadline: 2017.3.31

寻一名合作伙伴。
looking for Collaborators

可以直接提交代码到本项目,可以merge自己和他人的pull requests。
after you become collaborator, you can merge pull requests form you and others

需要在python/破解视频网站上有一定的经验。
require: python & related experience.

support gui

CLI is not good for end user, GUI is planned for future. target to V1.2.X, candidate GUI tool kit is QT5 (python-Qt5).

优酷 下载随机 403

extractor.py", line 145, in download_normal
save_urls(urls, name, self.streams[stream_id]['container'])
File "/Users/freestyler/git/bitbucket/d-service/lib/python2.7/site-packages/ykdl/util/download.py", line 57, in save_urls
save_url(u, n)
File "/Users/freestyler/git/bitbucket/d-service/lib/python2.7/site-packages/ykdl/util/download.py", line 28, in save_url
response = urlopen(req, None)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
return self._call_chain(_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden

多试几次又好了

iqiyi 只能解析到爱奇艺宣传片

https://github.com/soimort/you-get/issues/1211
ytdl-org/youtube-dl#9839
yan12125/iqiyi-hack#4

flash版播放器的分析卡在cmd5.calc
JS版播放器卡在SC的计算上。

我集中与 JS版。目前有的线索是:

j = '{{#list}}<div class="figure_list {{selected}}" item-data-tvid="{{album_tvid}}"><a clickplay href="{{url}}" class="figure_pic" title="" data-delegate="go" data-tvid="{{album_tvid}}" data-vid="{{album_vid}}"{{#uid}}data-sc="{{sc}}" data-cc="{{cc}}" data-un="{{album_un}}" data-vn="{{album_name}}" data-uid="{{uid}}" data-follow="{{album_follow}}" data-video_num="{{album_video_num}}" data-vip="{{album_vip}}" {{/uid}}data-page-tmplid="play" data-albumid="{{albumId}}"><img src="{{album_pic_url}}" alt="" /><div class="figure_mask"><p class="picList_info picList_info-right playTime">{{album_time_length}}</p></div></a><div class="figure_cont"><h3 class="figure_title"><a clickplay href="{{url}}" data-delegate="go" data-tvid="{{album_tvid}}" data-vid="{{album_vid}}" data-page-tmplid="play" data-albumid="{{albumId}}" {{#uid}}data-sc="{{sc}}" data-cc="{{cc}}" data-un="{{un}}" data-uid="{{uid}}" data-follow="{{followerCount}}" data-video_num={{userVideocount}} data-vip={{vip}}{{/uid}}>{{_subTitle}}</a></h3><div class="figure_num"><div class="mr20"><i class="ff-icon ff-playNum"></i><em class="num">{{playTotal}}</em></div></div></div></div>{{/list}}',
k = '{{#list}}<div class="figure_list {{selected}}" item-data-tvid="{{album_tvid}}"><a clickplay href="{{url}}" class="figure_pic" title="" data-delegate="go" data-tvid="{{album_tvid}}" data-vid="{{album_vid}}"{{#uid}}data-sc="{{sc}}" data-cc="{{cc}}" data-un="{{un}}" data-uid="{{uid}}" data-follow="{{followerCount}}" data-video_num={{userVideocount}} data-vip={{vip}}{{/uid}}data-page-tmplid="play" data-albumid="{{albumId}}"><img src="{{album_pic_url}}" alt="" /><div class="figure_mask"><p class="picList_info picList_info-right playTime">{{album_time_length}}</p></div></a><div class="figure_cont"><h3 class="figure_title"><a clickplay href="{{url}}" data-delegate="go" data-tvid="{{album_tvid}}" data-vid="{{album_vid}}" data-page-tmplid="play" data-albumid="{{albumId}}" {{#uid}}data-sc="{{sc}}" data-cc="{{cc}}" data-un="{{un}}" data-uid="{{uid}}" data-follow="{{followerCount}}" data-video_num={{userVideocount}} data-vip={{vip}}{{/uid}}>{{_subTitle}}</a></h3><div class="figure_num"><div class="mr20"><i class="ff-icon ff-playNum"></i><em class="num" id="albumId{{id}}">0</em></div></div></div></div>{{/list}}';

这段代码中是不是包含生成SC的线索。

熊猫tv解析同一个直播,地址不同。ykdl不能播放,you-get能。

D:\ykdl>ykdl video_urls http://www.panda.tv/11797
ykdl: invalid url: video_urls
site: 熊猫TV (Panda)
title: 战地1- Obang的浪漫就是拉大栓
artist: 哦棒
streams:
- format: current
container: flv
video-profile: current
size: inf MiB (inf bytes)
# download-with: ykdl --format=current [URL]
ykdl: Now downloading: 战地1- Obang的浪漫就是拉大栓_2016-10-31T19-24-33.924197.flv
ykdl: stop downloading by press 'q'
http://pl3.live.panda.tv/live_panda/fc7e94515e6b34161dfea57ab956e400.flv: Immediate exit requested
Exiting normally, received signal 2.

Interrupted by Ctrl-C

D:\ykdl>you-get -u http://www.panda.tv/11797
Site: panda.tv
Title: 战地1- Obang的浪漫就是拉大栓
Type: Flash video (video/x-flv)
Size: inf MiB (inf Bytes)

Real URLs:
http://pl10.live.panda.tv/live_panda/fc7e94515e6b34161dfea57ab956e400.flv

可以看到一个是pl3,一个是pl10.奇怪一个播放一个不行。。。

bilibili 又出问题了

ykdl http://www.bilibili.com/video/av6429835/
site:                哔哩哔哩 (Bilibili)
title:               路人超能100(灵能百分百) : 第12集 龙套与灵幻 ~巨大土龙出现 之篇~
artist:              None
streams:
    - format:        TD
      container:     flv
      video-profile: 超清
      size:          0.0 MiB (0 bytes)
    # download-with: ykdl --format=TD [URL]
Traceback (most recent call last):
  File "yk_dl.py", line 148, in <module>
  File "yk_dl.py", line 136, in main
  File "yk_dl.py", line 90, in handle_videoinfo
  File "yk_dl.py", line 53, in download
IndexError: list index out of range
Failed to execute script yk_dl
ykdl http://bangumi.bilibili.com/anime/v/92403
site:                哔哩哔哩 (Bilibili)
title:               路人超能100(灵能百分百) : 第12集 龙套与灵幻 ~巨大土龙出现 之篇~
artist:              None
streams:
    - format:        TD
      container:     flv
      video-profile: 超清
      size:          0.0 MiB (0 bytes)
    # download-with: ykdl --format=TD [URL]
Traceback (most recent call last):
  File "yk_dl.py", line 148, in <module>
  File "yk_dl.py", line 136, in main
  File "yk_dl.py", line 90, in handle_videoinfo
  File "yk_dl.py", line 53, in download
IndexError: list index out of range
Failed to execute script yk_dl

另外,上一版本的解析番剧页还能用

ykdl -i http://bangumi.bilibili.com/anime/v/92403
site:                哔哩哔哩 (Bilibili)
title:               路人超能100(灵能百分百) : 第12集 龙套与灵幻 ~巨大土龙出现 之篇~ 番剧 bilibili 哔哩哔哩弹幕视频网
artist:              None
streams:
    - format:        TD
      container:     flv
      video-profile: 超清
      size:          305.2 MiB (320000538 bytes)
    # download-with: ykdl --format=TD [URL]
Real urls:

support mp5hd stream code.

ykdl http://www.acfun.tv/v/ac3253653 -F TD
Traceback (most recent call last):
File "/home/zhangn1985/source/ykdl/bin/ykdl.py", line 148, in
main()
File "/home/zhangn1985/source/ykdl/bin/ykdl.py", line 127, in main
info = parser(u)
File "/home/zhangn1985/source/ykdl/ykdl/embedextractor.py", line 50, in parser
return s.parser(vid)
File "/home/zhangn1985/source/ykdl/ykdl/extractor.py", line 19, in parser
info = self.prepare()
File "/home/zhangn1985/source/ykdl/ykdl/extractors/youkubase.py", line 35, in prepare
stream_id = stream_code_to_id[stream['stream_type']]
KeyError: 'mp5hd'

爱奇艺,视频解析出错

ykdl -i http://www.iqiyi.com/v_19rr9h0t5g.html
site:                爱奇艺 (Iqiyi)
title:               广告宣传片
artist:              None
streams:
    - format:        HD
      container:     mp4
      video-profile: 540p
      size:          0.0 MiB (0 bytes)
    # download-with: ykdl --format=HD [URL]
Real urls:
http://60.210.17.241/videos/other/20160811/87/7a/52990d1c3b72ab7191e39934ff67c3d9.mp4?key=0f348cd8944b99660c02b3c13fbe8e8ad&src=iqiyi.com&uuid=ca6c0ef0-57ac2095-7a
    - format:        SD
      container:     mp4
      video-profile: 360p
      size:          0.0 MiB (0 bytes)
    # download-with: ykdl --format=SD [URL]
Real urls:
http://60.210.17.241/videos/other/20160811/87/7a/52990d1c3b72ab7191e39934ff67c3d9.mp4?key=0f348cd8944b99660c02b3c13fbe8e8ad&src=iqiyi.com&uuid=ca6c0ef0-57ac2095-7a

我试了试,其他视频正常。只有这儿的会解析出来广告

以后有可能下载到vip视频吗?

因为爱奇艺一堆版权VIP独播,所以在外面很难找到高清的下载(虽说爱奇艺那渣画质也是...)
不是指破解VIP那些,例如导入cookies那种方法也可以,因为最近you-get跟youtube-dl的爱奇艺解析经常出错,也解析不了1080p,所以就一直用这个ykdl来下载了,另外希望加入you-get或者youtube-dl那种只在解析时候用proxy的功能,you-get参数是-y,youtube-dl的参数是--geo-verification-proxy

bilibili 无法解析

ykdl -i http://www.bilibili.com/video/av6429835/
ykdl: can't play this video: http://www.bilibili.com/video/av6429835/

优酷解析问题

ykdl -i http://v.youku.com/v_show/id_XMTc0MTUxODEwNA==.html
ykdl: 优酷 (Youku) invalid segment key!

you-get还能解析
虽说现在付费视频都没法完整下载

iqiyi encode

我套用了不同的ffmpeg都出現這問題 不知道有沒有辦法解決
ffmpeg-20160629-57d30fd-win64-static.zip
ffmpeg-2.8.6-win32-static.7z
ffmpeg-2.8.6-win64-static.7z

[mp4 @ 06c7fb00] Non-monotonous DTS in output stream 0:0; previous: 32464160, cu
rrent: 27900000; changing to 32464161. This may result in incorrect timestamps i
n the output file.
[mp4 @ 06c7fb00] Non-monotonous DTS in output stream 0:0; previous: 32464161, cu
rrent: 27903600; changing to 32464162. This may result in incorrect timestamps i
n the output file.
[mp4 @ 06c7fb00] Non-monotonous DTS in output stream 0:0; previous: 32464162, cu
rrent: 27907200; changing to 32464163. This may result in incorrect timestamps i
n the output file.
[mp4 @ 06c7fb00] pts has no value
[NULL @ 02f70180] Error parsing ADTS frame header!
Failed to open bitstream filter aac_adtstoasc for stream 0 with codec copy: Inva
lid data found when processing input
[mp4 @ 06c7fb00] Non-monotonous DTS in output stream 0:1; previous: 15918749, cu
rrent: 13677108; changing to 15918750. This may result in incorrect timestamps i
n the output file.
[mp4 @ 06c7fb00] aac bitstream error
frame=34755 fps=315 q=-1.0 Lsize= 251800kB time=00:06:01.01 bitrate=5713.7kbits
/s
video:240434kB audio:10791kB subtitle:0kB other streams:0kB global headers:0kB m
uxing overhead: 0.229120%

letv live is broken.

Traceback (most recent call last):
  File "/home/zhangn1985/source/ykdl/bin/ykdl.py", line 148, in <module>
    main()
  File "/home/zhangn1985/source/ykdl/bin/ykdl.py", line 127, in main
    info = parser(u)
  File "/home/zhangn1985/source/ykdl/ykdl/extractor.py", line 19, in parser
    info = self.prepare()
  File "/home/zhangn1985/source/ykdl/ykdl/extractors/le/live.py", line 45, in prepare
    data = json.loads(get_content(streamUrl))
  File "/home/zhangn1985/source/ykdl/ykdl/util/html.py", line 62, in get_content
    response = urlopen(req)
  File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 420: GSLB

bilibili 番剧解析问题

视频播放页的URL解析提示

ykdl -i http://bangumi.bilibili.com/anime/427/play#71958
ykdl: can't play this video: http://bangumi.bilibili.com/anime/427/play#71958

对应av号的URL格式提示

ykdl -i https://www.bilibili.com/video/av2983852/
ykdl: can't play this video: https://www.bilibili.com/video/av2983852/

原来的URL格式倒是可行,但是每次都还需要手动修改URL格式啊

ykdl -i http://bangumi.bilibili.com/anime/v/71958
site:                哔哩哔哩 (Bilibili)
title:               某科学的超电磁炮S
artist:              None
streams:
    - format:        TD
      container:     flv
      video-profile: 超清
      size:          161.8 MiB (169697019 bytes)
    # download-with: ykdl --format=TD [URL]
Real urls:
http://ws.acgvideo.com/3/96/4672601-1.flv?wsTime=1482357108&wsSecret2=121a6092f4
a5ccf85aff06e344d13b34&oi=720167510&rate=2400
    - format:        HD
      container:     flv
      video-profile: 高清
      size:          161.1 MiB (168961753 bytes)
    # download-with: ykdl --format=HD [URL]
Real urls:
http://ws.acgvideo.com/3/96/4672601-1hd.mp4?wsTime=1482357108&wsSecret2=beacb942
a1b6ffcd19ee56249c9d21e2&oi=720167510&rate=2400
    - format:        SD
      container:     flv
      video-profile: 流畅
      size:          47.8 MiB (50150954 bytes)
    # download-with: ykdl --format=SD [URL]
Real urls:
http://ws.acgvideo.com/3/96/4672601-1.mp4?wsTime=1482357108&wsSecret2=bcdec5495c
f59a60a29910f8a1632b11&oi=720167510&rate=2000

A站解析不到正确的视频标题

ykdl -i http://www.acfun.cn/v/ac3410471
site:                AcFun 优酷合作视频
title:               AcFun 优酷合作视频-CMTA1NTkzMzY=
artist:              None
streams:

这导致下载下来的视频只看文件名有时候都不知道是什么内容

youku 下载有问题

ykdl http://v.youku.com/v_show/id_XMTYzMDc4NTg3Ng==.html
site:                优酷 (Youku)
title:               数码宝贝失落的进化,EP1一本正经乱翻译
artist:              None
streams:
    - format:        TD
      container:     flv
      video-profile: 超清
      size:          370.7 MiB (388679322 bytes)
    # download-with: ykdl --format=TD [URL]
Download: 数码宝贝失落的进化,EP1一本正经乱翻译_TD part 0
 100%
Download: 数码宝贝失落的进化,EP1一本正经乱翻译_TD part 1
Traceback (most recent call last):
  File "yk_dl.py", line 148, in <module>
  File "yk_dl.py", line 136, in main
  File "yk_dl.py", line 90, in handle_videoinfo
  File "yk_dl.py", line 69, in download
  File "site-packages\ykdl\util\download.py", line 61, in save_urls
  File "site-packages\ykdl\util\download.py", line 28, in save_url
  File "urllib\request.py", line 161, in urlopen
  File "urllib\request.py", line 470, in open
  File "urllib\request.py", line 580, in http_response
  File "urllib\request.py", line 508, in error
  File "urllib\request.py", line 442, in _call_chain
  File "urllib\request.py", line 588, in http_error_default
urllib.error.HTTPError: HTTP Error 403: Forbidden
Failed to execute script yk_dl

另外,我这里you-get正常

下载的格式

huyaLive下载 抓取的是m3u8下载保存的是mp4 也有flv流的
但mp4要完整视频才能播放 直播基本很难完整 只要中断mp4就会错误
希望改成TS或mkv 中断也能观看下载的视频 mp4只能删除无法使用
谢谢

tudou: need update

如果tudou的视频是host on tudou,并且这个视频没有嵌入到其他网站,例如cnbeta, hxx. 那么这个视频差不多就播放不了。

        data = json.loads(get_content('http://www.tudou.com/outplay/goto/getItemSegs.action?iid=%s' % self.vid))

返回的data问空。

花椒直播,VOD無法解析

花椒直播的直播串流是可正常使用的,但VOD的部份無法解析,
直播與VOD解析是類似的,希望未來能加入,謝謝作者分享這好用工具

http://g2.live.360.cn/vodplay?stype=m3u8&channel=live_huajiao_v2&bid=huajiao&sn={}&sid={}&_rate=xd&ts={}&r={}&_ostype=flash&_delay=0&_sign=null&_ver=13&dtype=non&tag=.m3u8

No

How to download Iqiyi V

爱奇艺下载出错

这两天下载爱奇艺视频时,下载了几个片段后就出现“由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试 失败。”的错误。

qq解析失败

ykdl.py -i http://v.qq.com/x/cover/x8yeqkvx56kelzm/u00214d75pq.html

Traceback (most recent call last):
  File "/usr/local/bin/ykdl.py", line 4, in <module>
    __import__('pkg_resources').run_script('ykdl==1.1.3.5', 'ykdl.py')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 742, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1674, in run_script
    exec(script_code, namespace, namespace)
  File "/Library/Python/2.7/site-packages/ykdl-1.1.3.5-py2.7.egg/EGG-INFO/scripts/ykdl.py", line 148, in <module>
  File "/Library/Python/2.7/site-packages/ykdl-1.1.3.5-py2.7.egg/EGG-INFO/scripts/ykdl.py", line 127, in main
  File "build/bdist.macosx-10.12-intel/egg/ykdl/extractor.py", line 19, in parser
  File "build/bdist.macosx-10.12-intel/egg/ykdl/extractors/qq/video.py", line 245, in prepare
  File "build/bdist.macosx-10.12-intel/egg/ykdl/extractors/qq/video.py", line 189, in get_stream_info
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 98, in splitext
    return genericpath._splitext(p, sep, altsep, extsep)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py", line 99, in _splitext
    sepIndex = p.rfind(sep)
AttributeError: 'NoneType' object has no attribute 'rfind'

qq 貌似有问题

试下这个链接:http://v.qq.com/x/cover/fl25yg9pru4vren.html

bin/ykdl -i http://v.qq.com/x/cover/fl25yg9pru4vren.html
Traceback (most recent call last):
File "bin/ykdl", line 20, in
main()
File "ykdl/main.py", line 119, in main
info = parser(u)
File "ykdl/extractor.py", line 19, in parser
info = self.prepare()
File "ykdl/extractors/qq/video.py", line 245, in prepare
title, fmt_name, type_name, urls, size = self.get_stream_info(stream)
File "ykdl/extractors/qq/video.py", line 172, in get_stream_info
filename = video.find('./fn').text
AttributeError: 'NoneType' object has no attribute 'find'
make: *** [test_qq] 错误 1

kankanews 解析有点儿问题

python -m ykdl -i http://www.kankanews.com/a/2017-01-12/0017842366.shtml
site:                看看新闻 (kankannews)
title:               None
artist:              None
streams:
    - format:        current
      container:     mp4
      video-profile: current
      size:          0.0 MiB (0 bytes)
    # download-with: ykdl --format=current [URL]
Real urls:

解析不出来视频的URL,好像和视频的发布日期有关

CNTV/CCTV 解析问题

现在完全不能解析

ykdl -i http://tv.cntv.cn/video/C15552/2ff20134b3e24db1a936dba14b0546bb
ykdl: Playlist is not supported for GeneralEmbed (通用嵌入视频)with url: http://tv.cntv.cn/video/C15552/2ff20134b3e24db1a936dba14b0546bb

顺带试了下,you-get倒是能把最低清晰度给解析出来

希望能够添加对 kankanews 的支持

现在会出现这样的情况

ykdl -i http://www.kankanews.com/a/2016-11-16/0017768642.shtml
ykdl: can't play this video: http://www.kankanews.com/a/2016-11-16/0017768642.shtml

其实原来根本就不支持

原因出在这儿
https://github.com/zhangn1985/ykdl/blob/master/ykdl/common.py#L26
这个坑是从you-get带过来的
https://github.com/soimort/you-get/blob/develop/src/you_get/common.py#L44

B站当时为了拿许可证跟kankanews合作,有一段时间在使用www.bilibili.com的同时还用了另一个bilibili.kankanews.com的域名。但是现在访问bilibili.kankanews.com开头的URL会直接跳转到B站(而且现在很难再会看到这种URL)

同样存在问题的还有这儿
https://github.com/zhangn1985/ykdl/blob/master/ykdl/common.py#L27
smgbbhttp://www.smgbb.cn/ ,和kankanews都是SMG的旗下网站。不过,业务经过调整,现在已经不提供免费视听服务了(且bilibili.smgbb.cnDNS解析都停了)

优酷 解析出现问题

python -m ykdl -i http://v.youku.com/v_show/id_XMTQwNzg2NTQ1Mg==.html
Traceback (most recent call last):
  File "D:\PortableApps\Python\lib\site-packages\ykdl\extractors\youku.py", line 42, in setup
    meta = json.loads(get_content(api_url))
  File "D:\PortableApps\Python\lib\site-packages\ykdl\util\html.py", line 62, in get_content
    response = urlopen(req)
  File "D:\PortableApps\Python\lib\urllib\request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "D:\PortableApps\Python\lib\urllib\request.py", line 472, in open
    response = meth(req, response)
  File "D:\PortableApps\Python\lib\urllib\request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "D:\PortableApps\Python\lib\urllib\request.py", line 510, in error
    return self._call_chain(*args)
  File "D:\PortableApps\Python\lib\urllib\request.py", line 444, in _call_chain
    result = func(*args)
  File "D:\PortableApps\Python\lib\urllib\request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Privoxy Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\PortableApps\Python\lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\PortableApps\Python\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\PortableApps\Python\lib\site-packages\ykdl\__main__.py", line 140, in <module>
    main()
  File "D:\PortableApps\Python\lib\site-packages\ykdl\__main__.py", line 119, in main
    info = parser(u)
  File "D:\PortableApps\Python\lib\site-packages\ykdl\extractor.py", line 19, in parser
    info = self.prepare()
  File "D:\PortableApps\Python\lib\site-packages\ykdl\extractors\youkubase.py", line 32, in prepare
    self.setup(info)
  File "D:\PortableApps\Python\lib\site-packages\ykdl\extractors\youku.py", line 48, in setup
    if 'error' in data1:
UnboundLocalError: local variable 'data1' referenced before assignment

automatic proxy detect on windows

On Linux maybe Mac, we can use os.getenv('http_proxy') to detect system proxy.

But on Windows, things different.

basically via register:

try:
    import winreg as registry
except:
    import _winreg as registry

key=registry.OpenKey(registry.HKEY_CURRENT_USER,"Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections",0,registry.KEY_ALL_ACCESS)
(value, regtype) = registry.QueryValueEx(key, "DefaultConnectionSettings")
print(value)

but value are binary format, I don't know how to parse it. help is needed.

notice: remove meaningless digital in version string.

current version is 1.1.4.1
as guided by http://semver.org/ , I rethink the version of the project.
first digital:
first digital, major version, 1 for CLI interface, 2 for GUI
second, minor version, impotent changes are made
third, patch version, small fix, no larger than 9.

so change next version string to 1.4.2 , remove first meaningless digital.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.