-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustom.py
36 lines (28 loc) · 867 Bytes
/
custom.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
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
import webbrowser
from tkinter import *
from time import sleep
def loadMainPage(url):
global mainSoup
page = urlopen(Request(url,headers={"User-Agent" :"Mozila/5"}))
mainSoup = BeautifulSoup(page.read(),'lxml')
def loadpage(url):
global soup
page = urlopen(Request(url,headers={"User-Agent" :"Mozila/5"}))
soup = BeautifulSoup(page.read(),'lxml')
def getDownloadPage(url):
global durl
loadMainPage(url)
durl = mainSoup.find('input',{'name':'FU'}).get('value')
print('Download Page URL :',durl)
loadMainPage(durl)
def openbrowser(url):
getDownloadPage(url)
webbrowser.open(durl)
def selecteDownload(url):
adsgolink = url
print(url)
loadpage(adsgolink)
boabd =soup.find('input').get('value')
webbrowser.open(boabd)