From f69fdfcf6a047ed58168a032e9499137d46d13b0 Mon Sep 17 00:00:00 2001 From: UrloMythus Date: Sat, 24 Aug 2024 12:04:11 +0200 Subject: [PATCH] Added separate file for dictionaries --- dictionaries.py | 32 ++++++++++++++++++++++++++++++++ okru.py | 7 +------ run.py | 28 +--------------------------- tantifilm.py | 8 ++++---- 4 files changed, 38 insertions(+), 37 deletions(-) create mode 100644 dictionaries.py diff --git a/dictionaries.py b/dictionaries.py new file mode 100644 index 0000000..c1a3371 --- /dev/null +++ b/dictionaries.py @@ -0,0 +1,32 @@ +okru = { + "rai1": "https://ok.ru/videoembed/7703488765552?nochat=1", + "rai2": "https://ok.ru/videoembed/7805618364016?nochat=1" +} + +STREAM = { + "channels": [ + { + "id": "la7", + "title": "LA7", + "url": "https://d3749synfikwkv.cloudfront.net/v1/master/3722c60a815c199d9c0ef36c5b73da68a62b09d1/cc-74ylxpgd78bpb/Live.m3u8" + }, + { + "id": "rai1", + "title": "Rai 1", + "url": "https://m3u.iranvids.com/rai01/output.m3u8", + "behaviorHints": { + "notWebReady": True, + "proxyHeaders": { + "request": { + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" + } + } + } + }, + { + "id": "rai2", + "title": "Rai 2", + "url": "https://m3u.iranvids.com/rai02/output.m3u8" + } + ] +} diff --git a/okru.py b/okru.py index cc24016..ae942b0 100644 --- a/okru.py +++ b/okru.py @@ -1,12 +1,7 @@ import requests from bs4 import BeautifulSoup import json -okru = { - "rai1": "https://ok.ru/videoembed/7703488765552?nochat=1", - "rai2": "https://ok.ru/videoembed/7805618364016?nochat=1" -} - - +from dictionaries import okru diff --git a/run.py b/run.py index 4f26d98..505529f 100644 --- a/run.py +++ b/run.py @@ -9,6 +9,7 @@ import config import logging from okru import okru_get_url from animeworld import animeworld +from dictionaries import okru, STREAM # Configure logging FILMPERTUTTI = config.FILMPERTUTTI STREAMINGCOMMUNITY = config.STREAMINGCOMMUNITY @@ -43,33 +44,6 @@ MANIFEST = { "description": "Addon providing HTTPS Stream for Italian Movies/Series", "logo": "https://creazilla-store.fra1.digitaloceanspaces.com/emojis/49647/pizza-emoji-clipart-md.png" } -STREAM = { - "channels": [ - { - "id": "la7", - "title": "LA7", - "url": "https://d3749synfikwkv.cloudfront.net/v1/master/3722c60a815c199d9c0ef36c5b73da68a62b09d1/cc-74ylxpgd78bpb/Live.m3u8" - }, - { - "id": "rai1", - "title": "Rai 1", - "url": "https://m3u.iranvids.com/rai01/output.m3u8", - "behaviorHints": { - "notWebReady": True, - "proxyHeaders": { - "request": { - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" - } - } - } - }, - { - "id": "rai2", - "title": "Rai 2", - "url": "https://m3u.iranvids.com/rai02/output.m3u8" - } - ] -} diff --git a/tantifilm.py b/tantifilm.py index 217e58f..9c1d2f1 100644 --- a/tantifilm.py +++ b/tantifilm.py @@ -10,7 +10,7 @@ TF_DOMAIN = config.TF_DOMAIN ##FOR NOW ONLY MOVIES WORK, I HOPE I CAN FIX SERIES def search(showname,ismovie,date): - url = f'https://www.tanti.bond/search/{showname}' + url = f'https://www.tanti.{TF_DOMAIN}/search/{showname}' response = requests.get(url) soup = BeautifulSoup(response.text, "lxml") if ismovie == 1: @@ -44,7 +44,7 @@ def search(showname,ismovie,date): return url,embed_id def fast_search(showname,ismovie): - url = f'https://www.tanti.bond/search/{showname}' + url = f'https://www.tanti.{TF_DOMAIN}/search/{showname}' response = requests.get(url) soup = BeautifulSoup(response.text, "lxml") if ismovie == 1: @@ -85,7 +85,7 @@ def get_protect_link(id,url): data = { 'id': embed_id } - ajax_url = "https://www.tanti.bond/ajax/embed" + ajax_url = f"https://www.tanti.{TF_DOMAIN}/ajax/embed" response = requests.post(ajax_url, headers=headers, data=data) hdplayer = response.text[43:-27] response = requests.get(hdplayer) @@ -119,7 +119,7 @@ def get_nuovo_indirizzo_and_protect_link(url,embed_id,season,episode): data = { 'id': embed_id } - ajax_url = "https://www.tanti.bond/ajax/embed" + ajax_url = f"https://www.tanti.{TF_DOMAIN}/ajax/embed" response = requests.post(ajax_url, headers=headers, data=data) nuovo_indirizzo = response.text[43:-27] response = requests.get(nuovo_indirizzo)