Skip to content

Commit 7481a70

Browse files
committed
novo padrão url zeppshered
1 parent 19b7cd6 commit 7481a70

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
chromedriver
22
.txt
3+
__pycache__

servers.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
import lxml.html
2-
from pytest import importorskip
32
import requests
4-
import re
3+
import re
4+
import math
55

66

77
compilado = re.compile('("[\/A-z0-9\+(%)\-." ]+)')
88
# (\([1-9 % +]+\))
99

10+
1011
def zshared(link: str) -> str:
1112
response = requests.get(link)
1213
URL = response.url.split('/v')[0]
1314
parser = lxml.html.fromstring(response.text)
1415

1516
javascript = parser.xpath('//script[@type="text/javascript"]')[5].text
16-
javascript = re.search(compilado, javascript).group(0).replace('+ (', '+ str(')
17-
download_path = eval(javascript)
18-
return URL + download_path
17+
base = int(javascript.split()[3].replace(';', ''))
18+
before_path = javascript.split()[-3].split('"')[1]
19+
after_path = javascript.split()[-2].split('"')[1]
20+
number_path = str(int(math.pow(base, 3) + 3))
21+
22+
return URL + before_path + number_path + after_path
23+
1924

25+
#breakpoint()
26+
zshared('https://www38.zippyshare.com/v/zHYZqNnZ/file.html')

0 commit comments

Comments
 (0)