Spaces:
Paused
Paused
UrloMythus commited on
Commit ·
e42b51d
1
Parent(s): 74a1e62
Wow
Browse files- filmpertutti.py +8 -3
- streamingcommunity.py +24 -3
filmpertutti.py
CHANGED
|
@@ -46,8 +46,9 @@ def search(query,date):
|
|
| 46 |
if release_date == date:
|
| 47 |
url = link
|
| 48 |
tid = tid
|
| 49 |
-
|
| 50 |
-
|
|
|
|
| 51 |
|
| 52 |
def get_episode_link(season,episode,tid,url):
|
| 53 |
#Get the link from where we have to obtain mixdrop link
|
|
@@ -101,7 +102,11 @@ def filmpertutti(imdb):
|
|
| 101 |
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
| 102 |
#Build the query
|
| 103 |
query = f'https://filmpertutti.{FT_DOMAIN}/wp-json/wp/v2/posts?search={showname}&page=1&_fields=link,id'
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
if ismovie == 0:
|
| 106 |
episode_link = get_episode_link(season,episode,tid,url)
|
| 107 |
#Let's get mixdrop link
|
|
|
|
| 46 |
if release_date == date:
|
| 47 |
url = link
|
| 48 |
tid = tid
|
| 49 |
+
return url, tid
|
| 50 |
+
else:
|
| 51 |
+
print("Date are not equals")
|
| 52 |
|
| 53 |
def get_episode_link(season,episode,tid,url):
|
| 54 |
#Get the link from where we have to obtain mixdrop link
|
|
|
|
| 102 |
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
| 103 |
#Build the query
|
| 104 |
query = f'https://filmpertutti.{FT_DOMAIN}/wp-json/wp/v2/posts?search={showname}&page=1&_fields=link,id'
|
| 105 |
+
try:
|
| 106 |
+
url,tid = search(query,date)
|
| 107 |
+
except:
|
| 108 |
+
print("No results found")
|
| 109 |
+
return None
|
| 110 |
if ismovie == 0:
|
| 111 |
episode_link = get_episode_link(season,episode,tid,url)
|
| 112 |
#Let's get mixdrop link
|
streamingcommunity.py
CHANGED
|
@@ -7,6 +7,7 @@ import dateparser
|
|
| 7 |
from convert import get_TMDb_id_from_IMDb_id
|
| 8 |
from info import get_info, is_movie
|
| 9 |
import config
|
|
|
|
| 10 |
#Get domain
|
| 11 |
SC_DOMAIN= config.SC_DOMAIN
|
| 12 |
|
|
@@ -15,6 +16,25 @@ headers = {
|
|
| 15 |
'Accept-Language': 'en-US,en;q=0.5'
|
| 16 |
}
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
def search(query):
|
| 19 |
#Do a request to get the ID of serie/move and it's slug in the URL
|
| 20 |
response = requests.get(query).json()
|
|
@@ -37,13 +57,13 @@ def get_film(tid):
|
|
| 37 |
url = f'https://vixcloud.co/playlist/{vixid}'
|
| 38 |
return url
|
| 39 |
|
| 40 |
-
def get_season_episode_id(tid,slug,season,episode):
|
| 41 |
#Set some basic headers for the request
|
| 42 |
headers = {
|
| 43 |
'user-agent': "Mozilla/5.0 (Windows NT 10.10; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
|
| 44 |
'x-inertia': 'true',
|
| 45 |
#Version of streaming community
|
| 46 |
-
'x-inertia-version':
|
| 47 |
}
|
| 48 |
#Get episode ID
|
| 49 |
response = requests.get(f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}/stagione-{season}', headers=headers)
|
|
@@ -99,7 +119,8 @@ def streaming_community(imdb):
|
|
| 99 |
return url
|
| 100 |
if ismovie == 0:
|
| 101 |
#Uid = URL ID
|
| 102 |
-
|
|
|
|
| 103 |
url = get_episode_link(episode_id,tid)
|
| 104 |
print(url)
|
| 105 |
return url
|
|
|
|
| 7 |
from convert import get_TMDb_id_from_IMDb_id
|
| 8 |
from info import get_info, is_movie
|
| 9 |
import config
|
| 10 |
+
import json
|
| 11 |
#Get domain
|
| 12 |
SC_DOMAIN= config.SC_DOMAIN
|
| 13 |
|
|
|
|
| 16 |
'Accept-Language': 'en-US,en;q=0.5'
|
| 17 |
}
|
| 18 |
|
| 19 |
+
#GET VERSION OF STREAMING COMMUNITY:
|
| 20 |
+
def get_version():
|
| 21 |
+
#Extract the version from the main page of the site
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
try:
|
| 25 |
+
base_url = f'https://streamingcommunity.{SC_DOMAIN}/richiedi-un-titolo'
|
| 26 |
+
response = requests.get(base_url, headers=headers)
|
| 27 |
+
#Soup the response
|
| 28 |
+
soup = BeautifulSoup(response.text, "lxml")
|
| 29 |
+
|
| 30 |
+
# Extract version
|
| 31 |
+
version = json.loads(soup.find("div", {"id": "app"}).get("data-page"))['version']
|
| 32 |
+
return version
|
| 33 |
+
except:
|
| 34 |
+
print("Couldn't find the version")
|
| 35 |
+
version = "65e52dcf34d64173542cd2dc6b8bb75b"
|
| 36 |
+
return version
|
| 37 |
+
|
| 38 |
def search(query):
|
| 39 |
#Do a request to get the ID of serie/move and it's slug in the URL
|
| 40 |
response = requests.get(query).json()
|
|
|
|
| 57 |
url = f'https://vixcloud.co/playlist/{vixid}'
|
| 58 |
return url
|
| 59 |
|
| 60 |
+
def get_season_episode_id(tid,slug,season,episode,version):
|
| 61 |
#Set some basic headers for the request
|
| 62 |
headers = {
|
| 63 |
'user-agent': "Mozilla/5.0 (Windows NT 10.10; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
|
| 64 |
'x-inertia': 'true',
|
| 65 |
#Version of streaming community
|
| 66 |
+
'x-inertia-version': version
|
| 67 |
}
|
| 68 |
#Get episode ID
|
| 69 |
response = requests.get(f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}/stagione-{season}', headers=headers)
|
|
|
|
| 119 |
return url
|
| 120 |
if ismovie == 0:
|
| 121 |
#Uid = URL ID
|
| 122 |
+
version = get_version()
|
| 123 |
+
episode_id = get_season_episode_id(tid,slug,season,episode,version)
|
| 124 |
url = get_episode_link(episode_id,tid)
|
| 125 |
print(url)
|
| 126 |
return url
|