Added Domain enviroment variable

This commit is contained in:
UrloMythus
2024-07-06 21:42:59 +02:00 Unverified
parent c7e53fdb6f
commit 933425ba1e
3 changed files with 11 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
TMDB_KEY= "713f5bb9e1903628cc8a41c487d833c4"
DOMAIN = "casino"
+1
View File
@@ -1 +1,2 @@
TMDB_KEY= "INSERT YOUR API KEY HERE" TMDB_KEY= "INSERT YOUR API KEY HERE"
DOMAIN = "INSERT DOMAIN"
+8
View File
@@ -12,6 +12,10 @@ from dotenv import load_dotenv
load_dotenv(".env") load_dotenv(".env")
TMDB_KEY = os.getenv('TMDB_KEY') TMDB_KEY = os.getenv('TMDB_KEY')
<<<<<<< HEAD
DOMAIN = os.getenv('DOMAIN')
=======
>>>>>>> e81f20e92a7c35f5b8dcbb683c746a0aea7795d4
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',
@@ -90,7 +94,11 @@ def search(query,date):
# Extract the href attribute from the link # Extract the href attribute from the link
href = link['href'] href = link['href']
#replace base url for easier scraping #replace base url for easier scraping
<<<<<<< HEAD
href = href.replace('definizionealta.com', f'filmpertutti.{DOMAIN}')
=======
href = href.replace('definizionealta.com', 'filmpertutti.casino') href = href.replace('definizionealta.com', 'filmpertutti.casino')
>>>>>>> e81f20e92a7c35f5b8dcbb683c746a0aea7795d4
#Get the correct serie by checking if the date is equals #Get the correct serie by checking if the date is equals
series_response = requests.get(href, headers=headers) series_response = requests.get(href, headers=headers)
series_soup = BeautifulSoup(series_response.text, 'html.parser') series_soup = BeautifulSoup(series_response.text, 'html.parser')