forked from larymak/Python-project-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudiobookfinder.py
More file actions
68 lines (47 loc) · 1.86 KB
/
audiobookfinder.py
File metadata and controls
68 lines (47 loc) · 1.86 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
from bs4 import BeautifulSoup
import requests
import webbrowser
booklinks = []
booktitles = []
def findfromgoldenaudiobooks(bookname):
URL = "https://goldenaudiobooks.com/?s="
r = requests.get(URL + bookname)
soup = BeautifulSoup(r.content, "html5lib")
booklist = soup.findAll("h2", attrs={"class": "entry-title"})
for book in booklist:
booklinks.append(book.a["href"])
booktitles.append(book.a.text)
def findfromfindaudiobooks(bookname):
URL = "https://findaudiobook.com/?s="
r = requests.get(URL + bookname)
soup = BeautifulSoup(r.content, "html5lib")
booklist = soup.findAll("h2", attrs={"class": "entry-title post-title"})
for book in booklist:
booklinks.append(book.a["href"])
booktitles.append(book.a.text)
def findfromfullengthaudiobooks(bookname):
URL = "https://fulllengthaudiobooks.com/?s="
r = requests.get(URL + bookname)
soup = BeautifulSoup(r.content, "html5lib")
booklist = soup.findAll("h2", attrs={"class": "entry-title post-title"})
for book in booklist:
booklinks.append(book.a["href"])
booktitles.append(book.a.text)
def findfrom101audiobooks(bookname):
URL = "https://101audiobooks.net/?s="
r = requests.get(URL + bookname)
soup = BeautifulSoup(r.content, "html5lib")
booklist = soup.findAll("h2", attrs={"class": "entry-title"})
for book in booklist:
booklinks.append(book.a["href"])
booktitles.append(book.a.text)
search = input("search for a book ")
findfromgoldenaudiobooks(search)
findfromfindaudiobooks(search)
findfromfullengthaudiobooks(search)
findfrom101audiobooks(search)
for x in range(1, len(booktitles) + 1):
print(str(x) + ": " + booktitles[x - 1])
booknum = int(input("select a book number "))
print("opening " + str(booklinks[booknum - 1]))
webbrowser.open(str(booklinks[booknum - 1]), new=2)