Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c69ef33

Browse files
Merge pull request #639 from neelshah2409/main
Next Episode Fetcher (TV Series)
2 parents 6ebe58b + 0d655f9 commit c69ef33

File tree

7 files changed

+73
-0
lines changed

7 files changed

+73
-0
lines changed
3.41 KB
Loading[フレーム]
6.33 KB
Loading[フレーム]
7.85 KB
Loading[フレーム]
7.39 KB
Loading[フレーム]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Next Episode Fetcher
2+
## Aim/Purpose
3+
To find the next episode date and time.
4+
## Short description of package/script
5+
6+
-Finding the airing date of next episode of your favourite TV shows is quite cumbersome job. Open the browser, Enter the link, and Search for the show.This python code snippet takes the name of the show you want to search and gives you the next airing date of the show.
7+
- List out the libraries imported ->tkinter ,requests and bs4.
8+
9+
## Setup instructions
10+
11+
For setup we need to install the given libraries and then run the script and then give the show name for which youneed to find next episode date and time.
12+
13+
14+
15+
## Output
16+
17+
![image](Images/output_1(episode).png)
18+
![image](Images/output_2(episode).png)
19+
![image](Images/output_3(episode).png)
20+
![image](Images/output_4(episode).png)
21+
22+
## Author(s)
23+
Neel Shah
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import requests
2+
import bs4
3+
from tkinter import *
4+
from tkinter import messagebox
5+
6+
#fetching the data from url
7+
def nextdate(name):
8+
try:
9+
res = requests.get("https://www.episodate.com/tv-show/" + name)
10+
soup = bs4.BeautifulSoup(res.text, 'html.parser')
11+
next_air_date = soup.find('div', {'class': 'countdown'})
12+
next_episode = str(next_air_date)[34:63]
13+
next_episode = next_episode.replace('"', "")
14+
next_episode = next_episode.replace("status", "")
15+
next_episode = next_episode.replace("/div><", "")
16+
next_episode = next_episode.replace("class=><a href=/sear",
17+
"Show not Found")
18+
if (next_episode == None):
19+
check = soup.find('div', {
20+
'class': 'countdown'
21+
}).find('div', {"class": "status"})
22+
check_status = check.getText()
23+
return check_status
24+
else:
25+
return next_episode
26+
except:
27+
return "Show Not Found"
28+
29+
## function for confirming the data
30+
def function():
31+
value = nextdate(e.get().lower())
32+
mylabel = Label(frame, text=e.get() + " " + value)
33+
mylabel.pack()
34+
messagebox.showinfo("Next airing date: " + e.get(), value)
35+
36+
#defining the main output grid
37+
value = ""
38+
root = Tk()
39+
root.title("Next Episode date")
40+
frame = LabelFrame(root,
41+
text="Find your TV Show/anime next Episode Date:",
42+
padx=5,
43+
pady=5)
44+
frame.pack(padx=10, pady=10)
45+
e = Entry(frame, width=25)
46+
e.pack()
47+
b = Button(frame, text="search", command=function)
48+
b.pack()
49+
root.mainloop()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Libraries used: tkinter, requests and bs4.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /