soimort on develop
fix douyin extractor (compare)
大家好,请问用ssr上YouTube的小白该怎么设置才能下载youtube的视频呢?(PS:我用最基本的you-get命令不能下载,国内的B站等就可以,我觉得应该就是gfw的问题~)
开ssr,在设置中勾选“允许局域网*”,然后再you-get -x 127.0.0.1:端口号 [URL]即可
[DEBUG] get_content: https://www.bilibili.com/video/BV1up4y1D774
[DEBUG] get_content: https://www.bilibili.com/video/BV1up4y1D774
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=198076290&otype=json&qn=112&quality=112&type=&sign=a7edfb00ecc2caebc9a9acb8451c1263
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=198076290&otype=json&qn=80&quality=80&type=&sign=8f86c7d3f445bbd7909c3e939ae6e556
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=198076290&otype=json&qn=64&quality=64&type=&sign=fd5991da6c6fc3921b7216ca11793459
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=198076290&otype=json&qn=32&quality=32&type=&sign=f2a71c386b7660d1772c0a07fe4c7fb8
[DEBUG] get_content: https://api.bilibili.com/x/player/playurl?avid=968446587&cid=198076290&qn=16&type=&otype=json&fnver=0&fnval=16
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=198076290&otype=json&qn=16&quality=16&type=&sign=79c500574cccbb36b8c2c131b2d21f30
卡在这里,ctrl+c也无法退出
下面这一句if判断里面的or好像不对,我看到bilibili实现中已经有一个正确的streams_sorted选中了720P,但是在extractor.py文件的download()函数中仍然对Dash视频进行了排序,结果反而选中了480P。
# Download stream with the best quality
print('Extractor.download():进入Download stream with the best quality!')
self.p([])
from .processor.ffmpeg import has_ffmpeg_installed
# bug:这里用or导致虽然此时已经有正确streams_sorted,但是仍然重新排序了
# if has_ffmpeg_installed() and player is None and self.dash_streams or not self.streams_sorted:
if has_ffmpeg_installed() and player is None and self.dash_streams and not self.streams_sorted:
print('Extractor.download():未排序,按size排序')
#stream_id = list(self.dash_streams)[-1]
itags = sorted(self.dash_streams,
key=lambda i: -self.dash_streams[i]['size'])
stream_id = itags[0]
else:
print('Extractor.download():已排序')
stream_id = self.streams_sorted[0]['id'] if 'id' in self.streams_sorted[0] else self.streams_sorted[0]['itag']
print('Extractor.download():选中的是stream_id={}'.format(stream_id))
extractor.py中的排序按size,但是这个视频它480P的比720P的size更大,结果extractor.py文件中的排序就错误了。
site: Bilibili
title: GAMES101-现代计算机图形学入门-闫令琪 (P1. Lecture 01 Overview of Computer Graphics)
streams: # Available quality and codecs
[ DASH ] ____________________________________
- format: dash-flv480
container: mp4
quality: 清晰 480P
size: 122.3 MiB (128219018 bytes)
# download-with: you-get --format=dash-flv480 [URL]
- format: dash-flv720
container: mp4
quality: 高清 720P
size: 122.1 MiB (127992296 bytes)
# download-with: you-get --format=dash-flv720 [URL]
- format: dash-flv360
container: mp4
quality: 流畅 360P
size: 93.1 MiB (97588721 bytes)
# download-with: you-get --format=dash-flv360 [URL]
[ DEFAULT ] _________________________________
- format: flv720
container: flv
quality: 高清 720P
size: 120.9 MiB (126785254 bytes)
# download-with: you-get --format=flv720 [URL]
- format: flv480
container: flv
quality: 清晰 480P
size: 123.0 MiB (128941600 bytes)
# download-with: you-get --format=flv480 [URL]
- format: flv360
container: flv
quality: 流畅 360P
size: 94.2 MiB (98782390 bytes)
# download-with: you-get --format=flv360 [URL]