From d2b56a2437d61f4e4c7f64d14c9a4fd088023488 Mon Sep 17 00:00:00 2001 From: Lovi <62809003+Lovi-0@users.noreply.github.com> Date: Thu, 30 Jan 2025 10:53:47 +0100 Subject: [PATCH] Update domain --- .github/workflows/update-loc-badge.yml | 6 +++--- README.md | 6 +++--- .../Api/Template/Util/get_domain.py | 16 ++++------------ config.json | 4 ++-- requirements.txt | 4 ++-- 5 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.github/workflows/update-loc-badge.yml b/.github/workflows/update-loc-badge.yml index 5708373..ab23e14 100644 --- a/.github/workflows/update-loc-badge.yml +++ b/.github/workflows/update-loc-badge.yml @@ -2,7 +2,7 @@ name: Update Lines of Code Badge on: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * 0' workflow_dispatch: jobs: @@ -18,12 +18,12 @@ jobs: - name: Count Lines of Code run: | LOC=$(cloc . --json | jq '.SUM.code') - echo "{\"schemaVersion\": 1, \"label\": \"Lines of Code\", \"message\": \"$LOC\", \"color\": \"green\"}" > loc-badge.json + echo "{\"schemaVersion\": 1, \"label\": \"Lines of Code\", \"message\": \"$LOC\", \"color\": \"green\"}" > Test/Util/loc-badge.json - name: Commit and Push LOC Badge run: | git config --local user.name "GitHub Actions" git config --local user.email "actions@github.com" - git add loc-badge.json + git add Test/Util/loc-badge.json git commit -m "Update lines of code badge" || echo "No changes to commit" git push \ No newline at end of file diff --git a/README.md b/README.md index d5141af..2a17245 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ PyPI Downloads - Lines of Code + Lines of Code

@@ -471,12 +471,12 @@ The `run-container` command mounts also the `config.json` file, so any change to | Website | Status | |:-------------------|:------:| | [1337xx](https://1337xx.to/) | ✅ | -| [AltadefinizioneGratis](https://altadefinizionegratis.info/) | ✅ | +| [AltadefinizioneGratis](https://altadefinizionegratis.site/) | ✅ | | [AnimeUnity](https://animeunity.so/) | ✅ | | [Ilcorsaronero](https://ilcorsaronero.link/) | ✅ | | [CB01New](https://cb01new.video/) | ✅ | | [DDLStreamItaly](https://ddlstreamitaly.co/) | ✅ | -| [GuardaSerie](https://guardaserie.academy/) | ✅ | +| [GuardaSerie](https://guardaserie.meme/) | ✅ | | [MostraGuarda](https://mostraguarda.stream/) | ✅ | | [StreamingCommunity](https://streamingcommunity.paris/) | ✅ | diff --git a/StreamingCommunity/Api/Template/Util/get_domain.py b/StreamingCommunity/Api/Template/Util/get_domain.py index 0c7fb09..53b444f 100644 --- a/StreamingCommunity/Api/Template/Util/get_domain.py +++ b/StreamingCommunity/Api/Template/Util/get_domain.py @@ -7,7 +7,7 @@ from urllib.parse import urlparse, unquote # External libraries import httpx -from serpapi import search +from googlesearch import search # Internal utilities @@ -15,7 +15,6 @@ from StreamingCommunity.Util.headers import get_headers from StreamingCommunity.Util.console import console, msg from StreamingCommunity.Util._jsonConfig import config_manager -api_key = "ebfaafb043613442e0010e3795c9ead4cab196e5448a6e3728d64edbbccdf731" base_headers = { 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'accept-language': 'it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7', @@ -76,7 +75,7 @@ def get_base_url(url_str): except Exception: return None -def validate_url(url, base_url, max_timeout, max_retries=3, sleep=3): +def validate_url(url, base_url, max_timeout, max_retries=2, sleep=1): """Validate if URL is accessible and matches expected base domain.""" console.print(f"\n[cyan]Starting validation for URL[white]: [yellow]{url}") @@ -164,16 +163,9 @@ def search_domain(site_name: str, base_url: str, get_first: bool = False): console.print(f"\n[cyan]Searching for alternate domains for[white]: [yellow]{base_domain}") try: - params = { - "q": base_domain, - "hl": "it", - "gl": "it", - "num": 20, - "api_key": api_key - } - search_results = [element['link'] for element in search(params)['organic_results']] - base_urls = set() + search_results = list(search(base_domain, num_results=20, lang="it")) + base_urls = set() for url in search_results: element_url = get_base_url(url) if element_url: diff --git a/config.json b/config.json index 505eb34..8dceaa8 100644 --- a/config.json +++ b/config.json @@ -62,10 +62,10 @@ "domain": "paris" }, "altadefinizionegratis": { - "domain": "info" + "domain": "site" }, "guardaserie": { - "domain": "academy" + "domain": "meme" }, "mostraguarda": { "domain": "stream" diff --git a/requirements.txt b/requirements.txt index 2422d29..01f23e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ unidecode jsbeautifier pathvalidate pycryptodomex +googlesearch-python fake-useragent qbittorrent-api -python-qbittorrent -serpapi \ No newline at end of file +python-qbittorrent \ No newline at end of file