Fixed StreamingCommunity version

This commit is contained in:
UrloMythus
2024-07-11 15:37:34 +02:00 Unverified
parent 8729f9b4fc
commit aace46d439
2 changed files with 32 additions and 6 deletions
+8 -3
View File
@@ -46,8 +46,9 @@ def search(query,date):
if release_date == date:
url = link
tid = tid
break
return url, tid
return url, tid
else:
print("Date are not equals")
def get_episode_link(season,episode,tid,url):
#Get the link from where we have to obtain mixdrop link
@@ -101,7 +102,11 @@ def filmpertutti(imdb):
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
#Build the query
query = f'https://filmpertutti.{FT_DOMAIN}/wp-json/wp/v2/posts?search={showname}&page=1&_fields=link,id'
url,tid = search(query,date)
try:
url,tid = search(query,date)
except:
print("No results found")
return None
if ismovie == 0:
episode_link = get_episode_link(season,episode,tid,url)
#Let's get mixdrop link
+24 -3
View File
@@ -7,6 +7,7 @@ import dateparser
from convert import get_TMDb_id_from_IMDb_id
from info import get_info, is_movie
import config
import json
#Get domain
SC_DOMAIN= config.SC_DOMAIN
@@ -15,6 +16,25 @@ headers = {
'Accept-Language': 'en-US,en;q=0.5'
}
#GET VERSION OF STREAMING COMMUNITY:
def get_version():
#Extract the version from the main page of the site
try:
base_url = f'https://streamingcommunity.{SC_DOMAIN}/richiedi-un-titolo'
response = requests.get(base_url, headers=headers)
#Soup the response
soup = BeautifulSoup(response.text, "lxml")
# Extract version
version = json.loads(soup.find("div", {"id": "app"}).get("data-page"))['version']
return version
except:
print("Couldn't find the version")
version = "65e52dcf34d64173542cd2dc6b8bb75b"
return version
def search(query):
#Do a request to get the ID of serie/move and it's slug in the URL
response = requests.get(query).json()
@@ -37,13 +57,13 @@ def get_film(tid):
url = f'https://vixcloud.co/playlist/{vixid}'
return url
def get_season_episode_id(tid,slug,season,episode):
def get_season_episode_id(tid,slug,season,episode,version):
#Set some basic headers for the request
headers = {
'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",
'x-inertia': 'true',
#Version of streaming community
'x-inertia-version': 'c1bdf1189cb68fca28151c8e909bd053'
'x-inertia-version': version
}
#Get episode ID
response = requests.get(f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}/stagione-{season}', headers=headers)
@@ -99,7 +119,8 @@ def streaming_community(imdb):
return url
if ismovie == 0:
#Uid = URL ID
episode_id = get_season_episode_id(tid,slug,season,episode)
version = get_version()
episode_id = get_season_episode_id(tid,slug,season,episode,version)
url = get_episode_link(episode_id,tid)
print(url)
return url