Spaces:
Paused
Paused
Update lordchannel.py
Browse files- lordchannel.py +34 -12
lordchannel.py
CHANGED
|
@@ -8,15 +8,40 @@ from convert import get_TMDb_id_from_IMDb_id
|
|
| 8 |
from info import get_info_tmdb, is_movie, get_info_imdb
|
| 9 |
import config
|
| 10 |
import re
|
|
|
|
| 11 |
LC_DOMAIN = config.LC_DOMAIN
|
| 12 |
-
def search(
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
link = f'https://lordchannel.{LC_DOMAIN}{href}'
|
| 21 |
response = requests.get(link)
|
| 22 |
soup2 = BeautifulSoup(response.text,'lxml')
|
|
@@ -24,7 +49,6 @@ def search(query,date,season,episode,ismovie):
|
|
| 24 |
if li_tag is not None: # check if the li_tag exists
|
| 25 |
card_date = li_tag.text[-4:]
|
| 26 |
if card_date == date:
|
| 27 |
-
quality = soup2.select('ul.card__list li')[0].text
|
| 28 |
if ismovie == 1:
|
| 29 |
video_url = soup2.find('a', class_="btn-streaming streaming_btn")
|
| 30 |
video_url = video_url['href']
|
|
@@ -70,9 +94,7 @@ def lordchannel(imdb):
|
|
| 70 |
else:
|
| 71 |
tmdba = imdb_id
|
| 72 |
showname,date = get_info_tmdb(tmdba,ismovie,type)
|
| 73 |
-
|
| 74 |
-
query = f'https://lordchannel.{LC_DOMAIN}/cerca/?q={showname}'
|
| 75 |
-
video_url,quality = search(query,date,season,episode,ismovie)
|
| 76 |
url = get_m3u8(video_url)
|
| 77 |
url = url.replace('"','')
|
| 78 |
print(url)
|
|
|
|
| 8 |
from info import get_info_tmdb, is_movie, get_info_imdb
|
| 9 |
import config
|
| 10 |
import re
|
| 11 |
+
import json
|
| 12 |
LC_DOMAIN = config.LC_DOMAIN
|
| 13 |
+
def search(showname,date,season,episode,ismovie):
|
| 14 |
+
cookies = {
|
| 15 |
+
'csrftoken': '7lvc502CZe8Zbx7iSX1xkZOBA1NbDxJZ',
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
headers = {
|
| 19 |
+
'authority': 'lordchannel.com',
|
| 20 |
+
'accept': '*/*',
|
| 21 |
+
'accept-language': 'it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7',
|
| 22 |
+
# 'cookie': 'csrftoken=7lvc502CZe8Zbx7iSX1xkZOBA1NbDxJZ',
|
| 23 |
+
'referer': 'https://lordchannel.com/anime/anime-ita/',
|
| 24 |
+
'sec-ch-ua': '"Not-A.Brand";v="99", "Chromium";v="124"',
|
| 25 |
+
'sec-ch-ua-mobile': '?0',
|
| 26 |
+
'sec-ch-ua-platform': '"Android"',
|
| 27 |
+
'sec-fetch-dest': 'empty',
|
| 28 |
+
'sec-fetch-mode': 'cors',
|
| 29 |
+
'sec-fetch-site': 'same-origin',
|
| 30 |
+
'user-agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
|
| 31 |
+
'x-requested-with': 'XMLHttpRequest',
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
params = {
|
| 35 |
+
'media': showname,
|
| 36 |
+
'_': '1724421723999',
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
response = requests.get('https://lordchannel.com/live_search/', params=params, cookies=cookies, headers=headers)
|
| 40 |
+
data = json.loads(response.text)
|
| 41 |
+
for entry in data['data']:
|
| 42 |
+
if entry is not None: # check if the a_tag exists
|
| 43 |
+
href = entry['url']
|
| 44 |
+
quality = entry['qualit\u00e0_video']
|
| 45 |
link = f'https://lordchannel.{LC_DOMAIN}{href}'
|
| 46 |
response = requests.get(link)
|
| 47 |
soup2 = BeautifulSoup(response.text,'lxml')
|
|
|
|
| 49 |
if li_tag is not None: # check if the li_tag exists
|
| 50 |
card_date = li_tag.text[-4:]
|
| 51 |
if card_date == date:
|
|
|
|
| 52 |
if ismovie == 1:
|
| 53 |
video_url = soup2.find('a', class_="btn-streaming streaming_btn")
|
| 54 |
video_url = video_url['href']
|
|
|
|
| 94 |
else:
|
| 95 |
tmdba = imdb_id
|
| 96 |
showname,date = get_info_tmdb(tmdba,ismovie,type)
|
| 97 |
+
video_url,quality = search(showname,date,season,episode,ismovie)
|
|
|
|
|
|
|
| 98 |
url = get_m3u8(video_url)
|
| 99 |
url = url.replace('"','')
|
| 100 |
print(url)
|