Fixed StreamingCommunity due to url change
This commit is contained in:
@@ -91,7 +91,6 @@ async def search(query,date,ismovie, client,SC_FAST_SEARCH,movie_id):
|
|||||||
response = await client.get(ForwardProxy + query, headers = random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
response = await client.get(ForwardProxy + query, headers = random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
||||||
print(response)
|
print(response)
|
||||||
response = response.json()
|
response = response.json()
|
||||||
|
|
||||||
for item in response['data']:
|
for item in response['data']:
|
||||||
tid = item['id']
|
tid = item['id']
|
||||||
slug = item['slug']
|
slug = item['slug']
|
||||||
@@ -106,7 +105,7 @@ async def search(query,date,ismovie, client,SC_FAST_SEARCH,movie_id):
|
|||||||
random_headers = headers.generate()
|
random_headers = headers.generate()
|
||||||
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
random_headers['Referer'] = f"{SC_DOMAIN}/"
|
||||||
random_headers['Origin'] = f"{SC_DOMAIN}"
|
random_headers['Origin'] = f"{SC_DOMAIN}"
|
||||||
response = await client.get ( ForwardProxy + f'{SC_DOMAIN}/titles/{tid}-{slug}', headers = random_headers, allow_redirects=True,impersonate = "chrome124", proxies = proxies)
|
response = await client.get ( ForwardProxy + f'{SC_DOMAIN}/it/titles/{tid}-{slug}', headers = random_headers, allow_redirects=True,impersonate = "chrome124", proxies = proxies)
|
||||||
soup = BeautifulSoup(response.text, "lxml")
|
soup = BeautifulSoup(response.text, "lxml")
|
||||||
data = json.loads(soup.find("div", {"id": "app"}).get("data-page"))
|
data = json.loads(soup.find("div", {"id": "app"}).get("data-page"))
|
||||||
version = data['version']
|
version = data['version']
|
||||||
@@ -136,9 +135,9 @@ async def get_film(tid,version,client,MFP):
|
|||||||
random_headers['User-Agent'] = User_Agent
|
random_headers['User-Agent'] = User_Agent
|
||||||
random_headers['user-agent'] = User_Agent
|
random_headers['user-agent'] = User_Agent
|
||||||
#Access the iframe
|
#Access the iframe
|
||||||
url = f'{SC_DOMAIN}/iframe/{tid}'
|
url = f'{SC_DOMAIN}/it/iframe/{tid}'
|
||||||
if MFP == "1":
|
if MFP == "1":
|
||||||
url = f'{SC_DOMAIN}/iframe/{tid}'
|
url = f'{SC_DOMAIN}/it/iframe/{tid}'
|
||||||
quality = "Unknown"
|
quality = "Unknown"
|
||||||
return url,quality
|
return url,quality
|
||||||
response = await client.get(ForwardProxy + url, headers=random_headers, allow_redirects=True,impersonate = "chrome124", proxies = proxies)
|
response = await client.get(ForwardProxy + url, headers=random_headers, allow_redirects=True,impersonate = "chrome124", proxies = proxies)
|
||||||
@@ -201,7 +200,7 @@ async def get_season_episode_id(tid,slug,season,episode,version,client):
|
|||||||
|
|
||||||
#Set some basic headers for the request
|
#Set some basic headers for the request
|
||||||
#Get episode ID
|
#Get episode ID
|
||||||
response = await client.get(ForwardProxy + f'{SC_DOMAIN}/titles/{tid}-{slug}/stagione-{season}', headers=random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
response = await client.get(ForwardProxy + f'{SC_DOMAIN}/it/titles/{tid}-{slug}/stagione-{season}', headers=random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
||||||
# Print the json got
|
# Print the json got
|
||||||
json_response = response.json().get('props', {}).get('loadedSeason', {}).get('episodes', [])
|
json_response = response.json().get('props', {}).get('loadedSeason', {}).get('episodes', [])
|
||||||
for dict_episode in json_response:
|
for dict_episode in json_response:
|
||||||
@@ -228,7 +227,7 @@ async def get_episode_link(episode_id,tid,version,client,MFP):
|
|||||||
url = f'{SC_DOMAIN}/iframe/{tid}?episode_id={episode_id}&next_episode=1'
|
url = f'{SC_DOMAIN}/iframe/{tid}?episode_id={episode_id}&next_episode=1'
|
||||||
quality = "Unknown"
|
quality = "Unknown"
|
||||||
return url,quality
|
return url,quality
|
||||||
response = await client.get(ForwardProxy + f"{SC_DOMAIN}/iframe/{tid}", params=params, headers = random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
response = await client.get(ForwardProxy + f"{SC_DOMAIN}/it/iframe/{tid}", params=params, headers = random_headers, allow_redirects=True, impersonate = "chrome124", proxies = proxies)
|
||||||
|
|
||||||
# Parse response with BeautifulSoup to get iframe source
|
# Parse response with BeautifulSoup to get iframe source
|
||||||
soup = BeautifulSoup(response.text, "lxml")
|
soup = BeautifulSoup(response.text, "lxml")
|
||||||
@@ -355,7 +354,7 @@ async def test_animeworld():
|
|||||||
from curl_cffi.requests import AsyncSession
|
from curl_cffi.requests import AsyncSession
|
||||||
async with AsyncSession() as client:
|
async with AsyncSession() as client:
|
||||||
# Replace with actual id, for example 'anime_id:episode' format
|
# Replace with actual id, for example 'anime_id:episode' format
|
||||||
test_id = "tt4772188" # This is an example ID format
|
test_id = "tt9218128" # This is an example ID format
|
||||||
results = await streaming_community(test_id, client,"0","0")
|
results = await streaming_community(test_id, client,"0","0")
|
||||||
print(results)
|
print(results)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user