Spaces:
Paused
Paused
Update streamingwatch.py
Browse files- streamingwatch.py +5 -4
streamingwatch.py
CHANGED
|
@@ -51,18 +51,19 @@ def search(showname,season,episode,date,ismovie):
|
|
| 51 |
|
| 52 |
return hdplayer
|
| 53 |
elif ismovie == 0:
|
| 54 |
-
query = f'https://streamingwatch.{SW_DOMAIN}/wp-json/wp/v2/posts?search={showname}'
|
| 55 |
response = requests.get(query)
|
| 56 |
data_json = response.text
|
| 57 |
data = json.loads(data_json)
|
| 58 |
for entry in data:
|
| 59 |
if f"stagione-{season}-episodio-{episode}" in entry["slug"]:
|
| 60 |
content = entry["content"]["rendered"]
|
|
|
|
| 61 |
#"content":{
|
| 62 |
# "rendered":"<p><!--baslik:PRO--><iframe loading=\"lazy\" src=\"https:\/\/hdplayer.gives\/embed\/YErLVq64uNTZRNz\" frameborder=\"0\" width=\"700\" height=\"400\" allowfullscreen><\/iframe><\/p>\n","protected":false}
|
| 63 |
-
|
| 64 |
-
end =
|
| 65 |
-
hdplayer =
|
| 66 |
return hdplayer
|
| 67 |
def hls_url(hdplayer):
|
| 68 |
response = requests.get(hdplayer)
|
|
|
|
| 51 |
|
| 52 |
return hdplayer
|
| 53 |
elif ismovie == 0:
|
| 54 |
+
query = f'https://streamingwatch.{SW_DOMAIN}/wp-json/wp/v2/posts?search={showname}&per_page=100'
|
| 55 |
response = requests.get(query)
|
| 56 |
data_json = response.text
|
| 57 |
data = json.loads(data_json)
|
| 58 |
for entry in data:
|
| 59 |
if f"stagione-{season}-episodio-{episode}" in entry["slug"]:
|
| 60 |
content = entry["content"]["rendered"]
|
| 61 |
+
print(content)
|
| 62 |
#"content":{
|
| 63 |
# "rendered":"<p><!--baslik:PRO--><iframe loading=\"lazy\" src=\"https:\/\/hdplayer.gives\/embed\/YErLVq64uNTZRNz\" frameborder=\"0\" width=\"700\" height=\"400\" allowfullscreen><\/iframe><\/p>\n","protected":false}
|
| 64 |
+
start = content.find('src="') + len('src="') #start of url
|
| 65 |
+
end = content.find('"', start) #end of url
|
| 66 |
+
hdplayer = content[start:end]
|
| 67 |
return hdplayer
|
| 68 |
def hls_url(hdplayer):
|
| 69 |
response = requests.get(hdplayer)
|