-
Notifications
You must be signed in to change notification settings - Fork 0
/
bypass.py
34 lines (21 loc) · 875 Bytes
/
bypass.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
import requests
import lxml.html
def Parser(text):
parser = lxml.html.fromstring(text)
url = parser.xpath('//a[@id="link"]')[0].get('href')
return url
def GetMagnetic(url):
s = requests.Session()
url_inicial = url
primeiraPagina = s.get(url_inicial)
parser_01 = Parser(primeiraPagina.text)
segundaPagina = s.get(parser_01)
parser_02 = Parser(segundaPagina.text)
terceiraPagina = s.get(parser_02)
parser_03 = Parser(terceiraPagina.text)
quartaPagina = s.get(parser_03)
parser_04 = Parser(quartaPagina.text) # + /?utm_source=facebook&utm_medium=social&utm_campaign=fanpages
paginaDoLink = s.get(parser_04)
paginaDoLinkParser = lxml.html.fromstring(paginaDoLink.text)
linkMagnetico = paginaDoLinkParser.xpath('//div[@id="baixar"]/p/a')[0].get('href')
return linkMagnetico