-
Notifications
You must be signed in to change notification settings - Fork 0
/
ugirl.py
36 lines (34 loc) · 1.22 KB
/
ugirl.py
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
28
29
30
31
32
33
34
35
36
import requests
import json
file = open('ugirlU系列.txt','w',encoding='utf-8')
#其他系列自己改下面的网址
url = 'http://www.ugirls8.com/api/discussions?include=startUser%2ClastUser%2CstartPost%2Ctags&filter%5Bq%5D=%20tag%3Au&'
response = requests.get(url)
cookies = response.cookies
response.encoding = 'utf-8'
response = response.text
content = json.loads(response)
for i in content['data']:
str = i['attributes']['title']
str = 'http://down.ugirls8.com/U/[Ugirls8.com]' + str + '.rar'
print(str)
file.write(str)
file.write('\n')
#生成第二页第三页地址
count = 1
while count < 3:
a = count * 20
url = 'http://www.ugirls8.com/api/discussions?include=startUser%2ClastUser%2CstartPost%2Ctags&filter%5Bq%5D=%20tag%3Au&page%5Boffset%5D={}'.format(a)
response = requests.get(url)
response.encoding = 'utf-8'
response = response.text
content = json.loads(response)
title = content['data'][0]['attributes']['title']
for j in content['data']:
str = j['attributes']['title']
str = str = 'http://down.ugirls8.com/U/[Ugirls8.com]' + str + '.rar'
file.write(str)
file.write('\n')
count = count + 1
file.close()
exit()