Skip to content

Commit 5886491

Browse files
committed
更新
1 parent d0a4dff commit 5886491

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

step1/acfun-video.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import requests
2+
import json
3+
#多p:https://www.acfun.cn/v/ac3202810_4
4+
#单p:https://www.acfun.cn/v/ac12607834
5+
url = 'https://www.acfun.cn/v/ac3202810_4'
6+
headers = {'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36'}
7+
rec = requests.get(url,headers=headers)
8+
#print(rec.text)
9+
10+
cutjson = rec.text
11+
str1 = cutjson.find('window.pageInfo = window.videoInfo = ')
12+
str2 = cutjson.find('window.qualityConfig =')
13+
videoinfo = cutjson[str1+37:str2-10]
14+
j = json.loads(videoinfo)
15+
16+
print(j['title'])
17+
print(j['description'])
18+
19+
if len(j['videoList']) == 1:
20+
#单p
21+
#print(j['currentVideoInfo']['ksPlayJson'])
22+
23+
j2 = json.loads(j['currentVideoInfo']['ksPlayJson'])
24+
for index in range(len(j2)):
25+
print(j2['adaptationSet']['representation'][index]['qualityType'])
26+
print(j2['adaptationSet']['representation'][index]['url'])
27+
print('**********'*30)
28+
else:
29+
#duop
30+
for index in range(len(j['videoList'])):
31+
print(j['videoList'][index]['title'])
32+
print(j['currentVideoInfo']['ksPlayJson'])

step1/bangumi.py

Whitespace-only changes.

0 commit comments

Comments
 (0)