樱花视频 http://www.imomoe.ai/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| import re
import requests
def get_url(url): string = requests.get(url).content.decode('gbk') return re.findall(re.compile(r'"(/playdata/\d*/\d*\.js?[^"]*)"'), string) pass
def get_videos(url): string = requests.get(url).content.decode('gbk').encode().decode('unicode_escape') pattern = re.compile(r"\'([^\'$]+?)\$(http[^$\']+?)\$") video_src = re.findall(pattern, string) return video_src
if __name__ == '__main__': host = 'http://www.imomoe.ai' url = get_url('http://www.imomoe.ai/player/7554-0-0.html') video_list = get_videos(host + url[0]) for video in video_list: print(video)
|