-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_anime.thehylia.com-soundtracks_.py
36 lines (23 loc) · 1.13 KB
/
_anime.thehylia.com-soundtracks_.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
from bs4 import BeautifulSoup
import requests
import re
file = open("thehylia-scraped.txt", "w")
def parsedPage(Link):
grabbedPage = requests.get(Link)
return (BeautifulSoup(grabbedPage.content, 'html.parser'))
def stringLink(Link):
regexResult = re.search('<a href=(.*)">', str(Link))
return (regexResult.group(1)[1:])
def checkLink(Page, String):
for x in Page:
if String in stringLink(x)
for hyperLink in parsedPage('https://anime.thehylia.com/soundtracks/browse/all').find_all('a'):
if 'album' in stringLink(hyperLink):
for hyperLink1 in parsedPage(stringLink(hyperLink)).find_all('a'):
if 'mp3' in stringLink(hyperLink1):
for hyperLink2 in parsedPage(stringLink(hyperLink1)).find_all('a'):
if 'anidl.vgmdownloads.com' in stringLink(hyperLink2):
theLink = stringLink(hyperLink2)[:-20]
print(theLink)
file.write(theLink + "\n")
file.close()