import json, requests, os
import urllib
results = {}
strategys = ['weekly', 'monthly', 'historical']
for strategy in strategys:
url = 'https://baobab.kaiyanapp.com/api/v4/rankList/videos?start=0&num=10000&strategy=' + strategy
r = requests.get(url)
json_data = json.loads(r.text)
item_list = json_data['itemList']
for item in item_list:
data = item['data']
id_str = data['id']
title = data['title']
playUrl = data['playUrl']
print playUrl
results[id_str] = {
'title': title,
'playUrl': playUrl
}
for key in results:
title = results[key]['title']
playUrl = results[key]['playUrl']
urllib.urlretrieve(playUrl, "videos/%s_%s.mp4" % (key, title))
print 'file "%s.mp4" done' % title
下载开眼的视频
最新推荐文章于 2023-12-05 11:30:35 发布