thejagstudio commited on
Commit
e2e2e1d
·
verified ·
1 Parent(s): 8dc9b73

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +360 -196
  2. requirements.txt +3 -1
app.py CHANGED
@@ -1,196 +1,360 @@
1
- from flask import Flask, render_template, redirect, url_for
2
- import requests
3
- from bs4 import BeautifulSoup
4
- from base64 import b64decode
5
- from Crypto.Cipher import AES
6
- from Crypto.Util.Padding import unpad
7
-
8
- app = Flask(__name__,static_url_path='/static', static_folder='static')
9
-
10
- def homeFetch():
11
- response = requests.get('https://www.shemaroome.com/')
12
- soup = BeautifulSoup(response.text,features="html5lib")
13
-
14
- # fetches all slider images
15
- slider = soup.find_all("div",{"class": "masthead-card"})
16
- sliderImages = []
17
- for element in slider:
18
- tempImage = element.find("img")
19
- sliderImages.append(tempImage['src'])
20
-
21
- # fetches all catagories with images
22
- catagory = soup.find_all("div",{"class": "float-left w-100 slick-container slick-gap"})
23
- catagoryObject =[]
24
- for element in catagory:
25
- tempTitle = element.find("h2")
26
- if tempTitle != None:
27
- tempTitle = str(tempTitle).split(">")[1].split("<")[0]
28
- tempImages = element.find_all("a")
29
- tempImagesArr = []
30
- for image in tempImages:
31
- try:
32
- imgLink = image.find("img")["src"]
33
- except:
34
- imgLink = ""
35
- tempImagesArr.append([image["href"],imgLink])
36
- catagoryObject.append([tempTitle,tempImagesArr])
37
- return sliderImages,catagoryObject
38
-
39
- def movieDetailFetch(title):
40
- response = requests.get('https://www.shemaroome.com/'+title)
41
- soup = BeautifulSoup(response.text,features="html5lib")
42
- pathList = []
43
- pathsContainer = soup.find("section",{"class": "main-content"})
44
- paths = pathsContainer.find("ul").find_all("li")
45
- for path in paths:
46
- if path.find("a"):
47
- pathList.append([path.find("a")["href"],path.text.strip()])
48
-
49
- title = soup.find("h1",{"class": "float-left w-100 app-color1 font-black margin-bottom-10 section-title2"}).text
50
-
51
- catagoriesArr = []
52
-
53
- catagories = soup.find_all("li",{"class":"float-left font-regular app-color5 app-color1"})
54
- for catagory in catagories:
55
- catagoriesArr.append(catagory.text.strip())
56
-
57
- movieDataArr = []
58
-
59
- Synopsis = soup.find_all("p",{"class":"float-left w-100 app-color1 font-regular"})
60
- for data in Synopsis:
61
- movieDataArr.append(data.text.strip())
62
-
63
- youMayLikeArr = []
64
-
65
- youMayLikeContainer = soup.find("div",{"class":"float-left w-100 app-slick-slider-container"})
66
- youMayLike = youMayLikeContainer.find_all("a")
67
- for data in youMayLike:
68
- youMayLikeArr.append([data["href"],data.find("img")["src"]])
69
-
70
- return {"pathList":pathList,"title":title,"catagoriesArr":catagoriesArr,"movieDataArr":movieDataArr,"youMayLikeArr":youMayLikeArr}
71
-
72
- def showDetailFetch(title):
73
- response = requests.get('https://www.shemaroome.com/'+title)
74
- soup = BeautifulSoup(response.text,features="html5lib")
75
-
76
- pathsContainer = soup.find("section",{"class": "main-content"})
77
- paths = pathsContainer.find("ul").find_all("li")
78
- pathList = []
79
- for path in paths:
80
- if path.find("a"):
81
- pathList.append([path.find("a")["href"],path.text.strip()])
82
-
83
- title = soup.find("h1",{"class": "float-left w-100 app-color1 font-black margin-bottom-10 section-title2"}).text.strip()
84
-
85
- catagories = soup.find_all("li",{"class":"float-left font-regular app-color5"})
86
- catagoriesArr = []
87
- for catagory in catagories:
88
- catagoriesArr.append(catagory.text.strip())
89
-
90
- Synopsis = soup.find_all("p",{"class":"float-left w-100 app-color1 font-regular"})
91
- movieDataArr = []
92
- for data in Synopsis:
93
- movieDataArr.append(data.text.strip())
94
-
95
- episodeContainer = soup.find_all("div",{"class":"float-left w-100 app-slick-slider-container"})[0]
96
- episodes = episodeContainer.find_all("a")
97
- episodesArr = []
98
- for episode in episodes:
99
- episodesArr.append([episode["href"],episode.find("img")["src"]])
100
-
101
- youMayLikeContainer = soup.find_all("div",{"class":"float-left w-100 app-slick-slider-container"})[1]
102
- youMayLike = youMayLikeContainer.find_all("a")
103
- youMayLikeArr = []
104
- for data in youMayLike:
105
- youMayLikeArr.append([data["href"],data.find("img")["src"]])
106
-
107
- poster = soup.find("div",{"class":"player_section w-100 embed-responsive embed-responsive-16by9"}).find("img")["src"]
108
- return {"pathList":pathList,"title":title,"catagoriesArr":catagoriesArr,"movieDataArr":movieDataArr,"episodesArr":episodesArr,"youMayLikeArr":youMayLikeArr,"poster":poster}
109
-
110
- def decryptLink(encrypted,key,type):
111
- key = b64decode(key)
112
- iv = b'0000000000000000'
113
- ct = b64decode(encrypted)
114
- cipher = AES.new(key, AES.MODE_CBC, iv)
115
- pt = unpad(cipher.decrypt(ct), AES.block_size)
116
- link = pt.decode()
117
- tempUrl = "https://d1fcqrzxghru70.cloudfront.net/"+link.split("cloudfront.net/")[1]
118
- response = requests.request("GET", tempUrl)
119
- tempArr = response.text.split("RESOLUTION=")
120
- tempArr.pop(0)
121
- tempUrl2 = '/'.join(tempUrl.split("/")[:-1])
122
- if type == "movie":
123
- resolutionLink = tempUrl2+"/"+tempArr[0].split("\n")[-2]
124
- else:
125
- resolutionLink = tempUrl2+"/"+tempArr[0].split("\n")[-2]
126
- return resolutionLink
127
-
128
- def stremKeyAPI(catalog_id,content_id,item_category,content_definition):
129
- url = "https://www.shemaroome.com/users/user_all_lists"
130
- payload = 'catalog_id='+catalog_id+'&content_id='+content_id + \
131
- '&category='+item_category+'&content_def='+content_definition
132
- response = requests.request("POST", url, data=payload)
133
- try:
134
- return {"streamKey":response.json()['stream_key'],"key":response.json()['key'],"newPlayUrl":response.json()['new_play_url'],"ios_key":response.json()['ios_key'],"ios_play_url":response.json()['ios_play_url'],"subtitle":response.json()['subtitle']}
135
- except:
136
- return {"error":"There's an error in data."}
137
-
138
- def pageLoderAPI(title):
139
- response = requests.request("GET", "https://www.shemaroome.com/"+title)
140
- soup = BeautifulSoup(response.text, features="html5lib")
141
- catalog_id = soup.find("input", {"id": "catalog_id"})['value']
142
- content_id = soup.find("input", {"id": "content_id"})['value']
143
- item_category = soup.find("input", {"id": "item_category"})['value']
144
- content_definition = soup.find("input", {"id": "content_definition"})['value']
145
- try:
146
- return {"catalog_id":catalog_id,"content_id":content_id,"item_category":item_category,"content_definition":content_definition}
147
- except:
148
- return {"error":"There's an error in URL."}
149
-
150
- @app.route('/')
151
- def home():
152
- sliderImages,catagoryObject = homeFetch()
153
- return render_template('home.html',sliderImages=sliderImages,catagoryObject=catagoryObject)
154
-
155
- @app.route('/movies/<title>')
156
- def movieDetail(title):
157
- try:
158
- dataObj = movieDetailFetch("movies/"+title)
159
- contentObj = pageLoderAPI("movies/"+title)
160
- keyData = stremKeyAPI(contentObj["catalog_id"],contentObj["content_id"],contentObj["item_category"],"AVOD")
161
- movieUrl = decryptLink(keyData["ios_play_url"],keyData["ios_key"],"movie")
162
- return render_template('detailMovie.html',dataObj=dataObj,movieUrl=movieUrl)
163
- except:
164
- return redirect(url_for('home'))
165
-
166
- @app.route('/gujarati-plays/<title>')
167
- def detailsGujaratiPlays(title):
168
- try:
169
- dataObj = movieDetailFetch("gujarati-plays/"+title)
170
- contentObj = pageLoderAPI("gujarati-plays/"+title)
171
- keyData = stremKeyAPI(contentObj["catalog_id"],contentObj["content_id"],contentObj["item_category"],"AVOD")
172
- movieUrl = decryptLink(keyData["ios_play_url"],keyData["ios_key"],"movie")
173
- return render_template('detailsGujaratiPlays.html',dataObj=dataObj,movieUrl=movieUrl)
174
- except:
175
- return redirect(url_for('home'))
176
-
177
- @app.route('/shows/<title>')
178
- def detailShowHome(title):
179
- try:
180
- dataObj = showDetailFetch("shows/"+title)
181
- return render_template('detailShowHome.html',dataObj=dataObj)
182
- except:
183
- return redirect(url_for('home'))
184
-
185
- @app.route('/shows/<title>/<episode>')
186
- def detailShowEpisode(title,episode):
187
- try:
188
- dataObj = showDetailFetch("shows/"+title+"/"+episode)
189
- contentObj = pageLoderAPI("shows/"+title+"/"+episode)
190
- keyData = stremKeyAPI(contentObj["catalog_id"],contentObj["content_id"],contentObj["item_category"],"AVOD")
191
- movieUrl = decryptLink(keyData["ios_play_url"],keyData["ios_key"],"show")
192
- return render_template('detailShowEpisode.html',dataObj=dataObj,movieUrl=movieUrl)
193
- except:
194
- return redirect(url_for('home'))
195
-
196
- app.run(host="0.0.0.0",port="7860",debug="true")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, render_template, redirect, url_for
2
+ import requests
3
+ from bs4 import BeautifulSoup
4
+ from base64 import b64decode
5
+ from Crypto.Cipher import AES
6
+ from Crypto.Util.Padding import unpad
7
+ from selenium import webdriver
8
+ from selenium.webdriver.chrome.service import Service
9
+ from selenium.webdriver.chrome.options import Options
10
+ from selenium.webdriver.common.by import By
11
+ from selenium.webdriver.support.ui import WebDriverWait
12
+ from selenium.webdriver.support import expected_conditions as EC
13
+ from webdriver_manager.chrome import ChromeDriverManager
14
+ import time
15
+
16
+ app = Flask(__name__, static_url_path='/static', static_folder='static')
17
+
18
+
19
+ def create_driver():
20
+ """Create and configure Chrome WebDriver"""
21
+ chrome_options = Options()
22
+ chrome_options.add_argument("--headless") # Run in background
23
+ chrome_options.add_argument("--no-sandbox")
24
+ chrome_options.add_argument("--disable-dev-shm-usage")
25
+ chrome_options.add_argument("--disable-gpu")
26
+ chrome_options.add_argument("--window-size=1920,1080")
27
+ chrome_options.add_argument("--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36")
28
+
29
+ service = Service(ChromeDriverManager().install())
30
+ driver = webdriver.Chrome(service=service, options=chrome_options)
31
+ return driver
32
+
33
+
34
+ def homeFetch():
35
+ driver = create_driver()
36
+ try:
37
+ driver.get('https://www.shemaroome.com/')
38
+ # Wait for the page to load
39
+ WebDriverWait(driver, 10).until(
40
+ EC.presence_of_element_located((By.CLASS_NAME, "masthead-card"))
41
+ )
42
+
43
+ # Get page source and parse with BeautifulSoup
44
+ page_source = driver.page_source
45
+ soup = BeautifulSoup(page_source, features="html5lib")
46
+
47
+ # fetches all slider images
48
+ slider = soup.find_all("div", {"class": "masthead-card"})
49
+ sliderImages = []
50
+ for element in slider:
51
+ tempImage = element.find("img")
52
+ if tempImage:
53
+ sliderImages.append(tempImage['src'])
54
+
55
+ # fetches all catagories with images
56
+ catagory = soup.find_all(
57
+ "div", {"class": "float-left w-100 slick-container slick-gap"})
58
+ catagoryObject = []
59
+ for element in catagory:
60
+ tempTitle = element.find("h2")
61
+ if tempTitle != None:
62
+ tempTitle = str(tempTitle).split(">")[1].split("<")[0]
63
+ tempImages = element.find_all("a")
64
+ tempImagesArr = []
65
+ for image in tempImages:
66
+ try:
67
+ imgLink = image.find("img")["src"]
68
+ except:
69
+ imgLink = ""
70
+ tempImagesArr.append([image["href"], imgLink])
71
+ catagoryObject.append([tempTitle, tempImagesArr])
72
+
73
+ return sliderImages, catagoryObject
74
+
75
+ finally:
76
+ driver.quit()
77
+
78
+
79
+ def movieDetailFetch(title):
80
+ driver = create_driver()
81
+ try:
82
+ driver.get('https://www.shemaroome.com/' + title)
83
+ # Wait for the main content to load
84
+ WebDriverWait(driver, 10).until(
85
+ EC.presence_of_element_located((By.CLASS_NAME, "main-content"))
86
+ )
87
+
88
+ page_source = driver.page_source
89
+ soup = BeautifulSoup(page_source, features="html5lib")
90
+
91
+ pathList = []
92
+ pathsContainer = soup.find("section", {"class": "main-content"})
93
+ if pathsContainer and pathsContainer.find("ul"):
94
+ paths = pathsContainer.find("ul").find_all("li")
95
+ for path in paths:
96
+ if path.find("a"):
97
+ pathList.append([path.find("a")["href"], path.text.strip()])
98
+
99
+ title_element = soup.find(
100
+ "h1", {
101
+ "class":
102
+ "float-left w-100 app-color1 font-black margin-bottom-10 section-title2"
103
+ })
104
+ title = title_element.text if title_element else ""
105
+
106
+ catagoriesArr = []
107
+ catagories = soup.find_all(
108
+ "li", {"class": "float-left font-regular app-color5 app-color1"})
109
+ for catagory in catagories:
110
+ catagoriesArr.append(catagory.text.strip())
111
+
112
+ movieDataArr = []
113
+ Synopsis = soup.find_all(
114
+ "p", {"class": "float-left w-100 app-color1 font-regular"})
115
+ for data in Synopsis:
116
+ movieDataArr.append(data.text.strip())
117
+
118
+ youMayLikeArr = []
119
+ youMayLikeContainer = soup.find(
120
+ "div", {"class": "float-left w-100 app-slick-slider-container"})
121
+ if youMayLikeContainer:
122
+ youMayLike = youMayLikeContainer.find_all("a")
123
+ for data in youMayLike:
124
+ img_element = data.find("img")
125
+ if img_element:
126
+ youMayLikeArr.append([data["href"], img_element["src"]])
127
+
128
+ return {
129
+ "pathList": pathList,
130
+ "title": title,
131
+ "catagoriesArr": catagoriesArr,
132
+ "movieDataArr": movieDataArr,
133
+ "youMayLikeArr": youMayLikeArr
134
+ }
135
+
136
+ finally:
137
+ driver.quit()
138
+
139
+
140
+ def showDetailFetch(title):
141
+ driver = create_driver()
142
+ try:
143
+ driver.get('https://www.shemaroome.com/' + title)
144
+ # Wait for the main content to load
145
+ WebDriverWait(driver, 10).until(
146
+ EC.presence_of_element_located((By.CLASS_NAME, "main-content"))
147
+ )
148
+
149
+ page_source = driver.page_source
150
+ soup = BeautifulSoup(page_source, features="html5lib")
151
+
152
+ pathsContainer = soup.find("section", {"class": "main-content"})
153
+ pathList = []
154
+ if pathsContainer and pathsContainer.find("ul"):
155
+ paths = pathsContainer.find("ul").find_all("li")
156
+ for path in paths:
157
+ if path.find("a"):
158
+ pathList.append([path.find("a")["href"], path.text.strip()])
159
+
160
+ title_element = soup.find(
161
+ "h1", {
162
+ "class":
163
+ "float-left w-100 app-color1 font-black margin-bottom-10 section-title2"
164
+ })
165
+ title = title_element.text.strip() if title_element else ""
166
+
167
+ catagories = soup.find_all("li",
168
+ {"class": "float-left font-regular app-color5"})
169
+ catagoriesArr = []
170
+ for catagory in catagories:
171
+ catagoriesArr.append(catagory.text.strip())
172
+
173
+ Synopsis = soup.find_all(
174
+ "p", {"class": "float-left w-100 app-color1 font-regular"})
175
+ movieDataArr = []
176
+ for data in Synopsis:
177
+ movieDataArr.append(data.text.strip())
178
+
179
+ episodesArr = []
180
+ episodeContainers = soup.find_all(
181
+ "div", {"class": "float-left w-100 app-slick-slider-container"})
182
+ if len(episodeContainers) > 0:
183
+ episodes = episodeContainers[0].find_all("a")
184
+ for episode in episodes:
185
+ img_element = episode.find("img")
186
+ if img_element:
187
+ episodesArr.append([episode["href"], img_element["src"]])
188
+
189
+ youMayLikeArr = []
190
+ if len(episodeContainers) > 1:
191
+ youMayLike = episodeContainers[1].find_all("a")
192
+ for data in youMayLike:
193
+ img_element = data.find("img")
194
+ if img_element:
195
+ youMayLikeArr.append([data["href"], img_element["src"]])
196
+
197
+ poster = ""
198
+ poster_element = soup.find(
199
+ "div", {
200
+ "class": "player_section w-100 embed-responsive embed-responsive-16by9"
201
+ })
202
+ if poster_element:
203
+ img_element = poster_element.find("img")
204
+ if img_element:
205
+ poster = img_element["src"]
206
+
207
+ return {
208
+ "pathList": pathList,
209
+ "title": title,
210
+ "catagoriesArr": catagoriesArr,
211
+ "movieDataArr": movieDataArr,
212
+ "episodesArr": episodesArr,
213
+ "youMayLikeArr": youMayLikeArr,
214
+ "poster": poster
215
+ }
216
+
217
+ finally:
218
+ driver.quit()
219
+
220
+
221
+ def decryptLink(encrypted, key, type):
222
+ key = b64decode(key)
223
+ iv = b'0000000000000000'
224
+ ct = b64decode(encrypted)
225
+ cipher = AES.new(key, AES.MODE_CBC, iv)
226
+ pt = unpad(cipher.decrypt(ct), AES.block_size)
227
+ link = pt.decode()
228
+ tempUrl = "https://d1fcqrzxghru70.cloudfront.net/" + \
229
+ link.split("cloudfront.net/")[1]
230
+ response = requests.request("GET", tempUrl)
231
+ tempArr = response.text.split("RESOLUTION=")
232
+ tempArr.pop(0)
233
+ tempUrl2 = '/'.join(tempUrl.split("/")[:-1])
234
+ bestResolution = 0
235
+ for i in range(len(tempArr)):
236
+ if int(tempArr[i].split("x")[0]) > int(
237
+ tempArr[bestResolution].split("x")[0]):
238
+ bestResolution = i
239
+ resolutionLink = tempUrl2 + "/" + tempArr[bestResolution].split("\n")[-2]
240
+ return resolutionLink
241
+
242
+
243
+ def stremKeyAPI(catalog_id, content_id, item_category, content_definition):
244
+ url = "https://www.shemaroome.com/users/user_all_lists"
245
+ payload = 'catalog_id='+catalog_id+'&content_id='+content_id + \
246
+ '&category='+item_category+'&content_def='+content_definition
247
+ response = requests.request("POST", url, data=payload)
248
+ try:
249
+ return {
250
+ "streamKey": response.json()['stream_key'],
251
+ "key": response.json()['key'],
252
+ "newPlayUrl": response.json()['new_play_url'],
253
+ "ios_key": response.json()['ios_key'],
254
+ "ios_play_url": response.json()['ios_play_url'],
255
+ "subtitle": response.json()['subtitle']
256
+ }
257
+ except:
258
+ return {"error": "There's an error in data."}
259
+
260
+
261
+ def pageLoderAPI(title):
262
+ driver = create_driver()
263
+ try:
264
+ driver.get("https://www.shemaroome.com/" + title)
265
+ # Wait for the page to load
266
+ WebDriverWait(driver, 10).until(
267
+ EC.presence_of_element_located((By.ID, "catalog_id"))
268
+ )
269
+
270
+ page_source = driver.page_source
271
+ soup = BeautifulSoup(page_source, features="html5lib")
272
+
273
+ catalog_id_elem = soup.find("input", {"id": "catalog_id"})
274
+ content_id_elem = soup.find("input", {"id": "content_id"})
275
+ item_category_elem = soup.find("input", {"id": "item_category"})
276
+ content_definition_elem = soup.find("input", {"id": "content_definition"})
277
+
278
+ if not all([catalog_id_elem, content_id_elem, item_category_elem, content_definition_elem]):
279
+ return {"error": "Required elements not found on page."}
280
+
281
+ return {
282
+ "catalog_id": catalog_id_elem['value'],
283
+ "content_id": content_id_elem['value'],
284
+ "item_category": item_category_elem['value'],
285
+ "content_definition": content_definition_elem['value']
286
+ }
287
+ except Exception as e:
288
+ return {"error": f"There's an error in URL: {str(e)}"}
289
+ finally:
290
+ driver.quit()
291
+
292
+
293
+ @app.route('/')
294
+ def home():
295
+ sliderImages, catagoryObject = homeFetch()
296
+ return render_template('home.html',
297
+ sliderImages=sliderImages,
298
+ catagoryObject=catagoryObject)
299
+
300
+
301
+ @app.route('/hello')
302
+ def hello():
303
+ return "Hello world from Shemaroome!"
304
+
305
+
306
+ @app.route('/movies/<title>')
307
+ def movieDetail(title):
308
+ try:
309
+ dataObj = movieDetailFetch("movies/" + title)
310
+ contentObj = pageLoderAPI("movies/" + title)
311
+ keyData = stremKeyAPI(contentObj["catalog_id"], contentObj["content_id"],
312
+ contentObj["item_category"], "AVOD")
313
+ movieUrl = decryptLink(keyData["ios_play_url"], keyData["ios_key"], "movie")
314
+ return render_template('detailMovie.html',
315
+ dataObj=dataObj,
316
+ movieUrl=movieUrl)
317
+ except:
318
+ return redirect(url_for('home'))
319
+
320
+
321
+ @app.route('/gujarati-plays/<title>')
322
+ def detailsGujaratiPlays(title):
323
+ try:
324
+ dataObj = movieDetailFetch("gujarati-plays/" + title)
325
+ contentObj = pageLoderAPI("gujarati-plays/" + title)
326
+ keyData = stremKeyAPI(contentObj["catalog_id"], contentObj["content_id"],
327
+ contentObj["item_category"], "AVOD")
328
+ movieUrl = decryptLink(keyData["ios_play_url"], keyData["ios_key"], "movie")
329
+ return render_template('detailsGujaratiPlays.html',
330
+ dataObj=dataObj,
331
+ movieUrl=movieUrl)
332
+ except:
333
+ return redirect(url_for('home'))
334
+
335
+
336
+ @app.route('/shows/<title>')
337
+ def detailShowHome(title):
338
+ try:
339
+ dataObj = showDetailFetch("shows/" + title)
340
+ return render_template('detailShowHome.html', dataObj=dataObj)
341
+ except:
342
+ return redirect(url_for('home'))
343
+
344
+
345
+ @app.route('/shows/<title>/<episode>')
346
+ def detailShowEpisode(title, episode):
347
+ try:
348
+ dataObj = showDetailFetch("shows/" + title + "/" + episode)
349
+ contentObj = pageLoderAPI("shows/" + title + "/" + episode)
350
+ keyData = stremKeyAPI(contentObj["catalog_id"], contentObj["content_id"],
351
+ contentObj["item_category"], "AVOD")
352
+ movieUrl = decryptLink(keyData["ios_play_url"], keyData["ios_key"], "show")
353
+ return render_template('detailShowEpisode.html',
354
+ dataObj=dataObj,
355
+ movieUrl=movieUrl)
356
+ except:
357
+ return redirect(url_for('home'))
358
+
359
+
360
+ app.run(host="0.0.0.0", port="8080", debug="true")
requirements.txt CHANGED
@@ -3,4 +3,6 @@ requests
3
  beautifulsoup4
4
  pycryptodome
5
  html5lib
6
- lxml
 
 
 
3
  beautifulsoup4
4
  pycryptodome
5
  html5lib
6
+ lxml
7
+ selenium
8
+ webdriver-manager