Fixed StreamingCommunity version
This commit is contained in:
+6
-1
@@ -46,8 +46,9 @@ def search(query,date):
|
|||||||
if release_date == date:
|
if release_date == date:
|
||||||
url = link
|
url = link
|
||||||
tid = tid
|
tid = tid
|
||||||
break
|
|
||||||
return url, tid
|
return url, tid
|
||||||
|
else:
|
||||||
|
print("Date are not equals")
|
||||||
|
|
||||||
def get_episode_link(season,episode,tid,url):
|
def get_episode_link(season,episode,tid,url):
|
||||||
#Get the link from where we have to obtain mixdrop link
|
#Get the link from where we have to obtain mixdrop link
|
||||||
@@ -101,7 +102,11 @@ def filmpertutti(imdb):
|
|||||||
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
showname = showname.replace(" ", "+").replace("–", "+").replace("—","+")
|
||||||
#Build the query
|
#Build the query
|
||||||
query = f'https://filmpertutti.{FT_DOMAIN}/wp-json/wp/v2/posts?search={showname}&page=1&_fields=link,id'
|
query = f'https://filmpertutti.{FT_DOMAIN}/wp-json/wp/v2/posts?search={showname}&page=1&_fields=link,id'
|
||||||
|
try:
|
||||||
url,tid = search(query,date)
|
url,tid = search(query,date)
|
||||||
|
except:
|
||||||
|
print("No results found")
|
||||||
|
return None
|
||||||
if ismovie == 0:
|
if ismovie == 0:
|
||||||
episode_link = get_episode_link(season,episode,tid,url)
|
episode_link = get_episode_link(season,episode,tid,url)
|
||||||
#Let's get mixdrop link
|
#Let's get mixdrop link
|
||||||
|
|||||||
+24
-3
@@ -7,6 +7,7 @@ import dateparser
|
|||||||
from convert import get_TMDb_id_from_IMDb_id
|
from convert import get_TMDb_id_from_IMDb_id
|
||||||
from info import get_info, is_movie
|
from info import get_info, is_movie
|
||||||
import config
|
import config
|
||||||
|
import json
|
||||||
#Get domain
|
#Get domain
|
||||||
SC_DOMAIN= config.SC_DOMAIN
|
SC_DOMAIN= config.SC_DOMAIN
|
||||||
|
|
||||||
@@ -15,6 +16,25 @@ headers = {
|
|||||||
'Accept-Language': 'en-US,en;q=0.5'
|
'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):
|
def search(query):
|
||||||
#Do a request to get the ID of serie/move and it's slug in the URL
|
#Do a request to get the ID of serie/move and it's slug in the URL
|
||||||
response = requests.get(query).json()
|
response = requests.get(query).json()
|
||||||
@@ -37,13 +57,13 @@ def get_film(tid):
|
|||||||
url = f'https://vixcloud.co/playlist/{vixid}'
|
url = f'https://vixcloud.co/playlist/{vixid}'
|
||||||
return url
|
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
|
#Set some basic headers for the request
|
||||||
headers = {
|
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",
|
'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',
|
'x-inertia': 'true',
|
||||||
#Version of streaming community
|
#Version of streaming community
|
||||||
'x-inertia-version': 'c1bdf1189cb68fca28151c8e909bd053'
|
'x-inertia-version': version
|
||||||
}
|
}
|
||||||
#Get episode ID
|
#Get episode ID
|
||||||
response = requests.get(f'https://streamingcommunity.{SC_DOMAIN}/titles/{tid}-{slug}/stagione-{season}', headers=headers)
|
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
|
return url
|
||||||
if ismovie == 0:
|
if ismovie == 0:
|
||||||
#Uid = URL ID
|
#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)
|
url = get_episode_link(episode_id,tid)
|
||||||
print(url)
|
print(url)
|
||||||
return url
|
return url
|
||||||
Reference in New Issue
Block a user