-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfixsub.py
More file actions
72 lines (59 loc) · 1.83 KB
/
Copy pathfixsub.py
File metadata and controls
72 lines (59 loc) · 1.83 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/python3
# -*- coding:utf-8 -*-
import requests
import lxml
from bs4 import BeautifulSoup
baidu = []
qingt = []
magnet = []
emule = []
tv_url = input('请输入剧集地址\n格式为: http://www.zimuxia.cn/portfolio/[剧集名]\n')
with requests.Session() as session:
resp = session.get(tv_url, timeout=10)
resp.raise_for_status()
soup = BeautifulSoup(resp.content, 'lxml', from_encoding=resp.encoding)
baidu_text = soup.find_all(text='百度网盘')
if baidu_text != None:
for i in range(len(baidu_text)):
baidu_parent = baidu_text[i].parent
baidu.append(baidu_parent.get('href'))
qingt_text = soup.find_all(text='青铜网盘')
if qingt_text != None:
for i in range(len(qingt_text)):
qingt_parent = qingt_text[i].parent
qingt.append(qingt_parent.get('href'))
magnet_text = soup.find_all(text='磁力下载')
if magnet_text != None:
for i in range(len(magnet_text)):
magnet_parent = magnet_text[i].parent
magnet.append(magnet_parent.get('href'))
emule_text = soup.find_all(text='电驴下载')
if emule_text != None:
for i in range(len(emule_text)):
emule_parent = emule_text[i].parent
emule.append(emule_parent.get('href'))
if baidu == []:
print('无百度云链接')
else:
print('百度云:')
for i in range(len(baidu)):
print(baidu[i])
if qingt == []:
print('无青铜链接')
else:
print('青铜:')
for i in range(len(qingt)):
print(qingt[i])
if magnet == []:
print('无磁力链')
else:
print('磁力链:')
for i in range(len(magnet)):
print(magnet[i])
if emule == []:
print('无ed2k链接')
else:
print('ed2k:')
for i in range(len(emule)):
print(emule[i])
input('Press ENTER to exit …')