iawia002/Lulu

下载优酷视频时出现ValueError: Sign not allowed in string format specifier 错误

Open

#52 opened on Feb 9, 2018

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Python (140 forks)github user discovery
commonhelp wanted

Repository metrics

Stars
 (804 stars)
PR merge metrics
 (PR metrics pending)

Description

系统环境: Android 7.1.2 Termux Python3.6.4 lulu 0.3.2

下载一般睿站视频时亦有可能发生这个问题。


输出全文如下

$ lulu -V
lulu: version 0.3.2, a tiny downloader that scrapes the web.
$ lulu -d --format=mp4hd http://v.youku.com/v_show/id_XNjA4MzA1MjY4
[DEBUG] get_content: https://ups.youku.com/ups/get.json?vid=XNjA4MzA1MjY4&ccode=0507&client_ip=192.168.1.1&utid=VxAEE1fOSgYCAa%2BjQ4XPTyNf&client_ts=1518150235
lulu: version 0.3.2, a tiny downloader that scrapes the web.
lulu: Namespace(URL=['http://v.youku.com/v_show/id_XNjA4MzA1MjY4';], cookies=None, debug=True, extractor_proxy=None, force=False, format='mp4hd', help=False, http_proxy=None, info=False, input_file=None, itag=None, json=False, no_caption=False, no_merge=False, no_proxy=False, output_dir='.', output_filename=None, password=None, player=None, playlist=False, socks_proxy=None, stream=None, timeout=600, url=False, version=False)
site: 优酷 (Youku)
title: 龙兄虎弟
stream:
- format: mp4hd
container: mp4
video-profile: 高清
size: 385.39999999999998 MiB (404139132 bytes)
m3u8_url: http://pl.cp12.wasu.tv/playlist/m3u8?vid=XNjA4MzA1MjY4&type=mp4&ups_client_netip=afa34385&utid=VxAEE1fOSgYCAa%2BjQ4XPTyNf&ccode=0507&psid=9b4d4e221d79a349d536e48a9b6f0c98&duration=5869&expire=18000&ups_ts=1518150234&onOff=0&encr=1&ups_key=3392a85de76518cbcf4922cf2c5a0c75
# download-with: lulu --format=mp4hd [URL]

audio-languages:
- lang: 国语
download-url: http://v.youku.com/v_show/id_XNjA4MzA1MjY4

- lang: 粤语
download-url: http://v.youku.com/v_show/id_XNzMyMDUwNDgw

Downloading 龙兄虎弟.mp4 ...
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/bin/lulu", line 11, in <module>
sys.exit(main())
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/__main__.py", line 92, in main
main(**kwargs)
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/common.py", line 1485, in main
script_main(any_download, any_download_playlist, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/common.py", line 1375, in script_main
**extra
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/common.py", line 1121, in download_main
download(url, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/common.py", line 1476, in any_download
m.download(url, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/extractors/youku.py", line 349, in youku_download_by_url
Youku().download_by_url(url, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/extractor.py", line 86, in download_by_url
self.download(**kwargs)
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/extractor.py", line 302, in download
av=stream_id in self.dash_streams
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/common.py", line 802, in download_urls
bar.update()
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/lulu/common.py", line 651, in update
self.current_piece, self.total_pieces, self.speed
ValueError: Sign not allowed in string format specifier

Contributor guide