Skip to content

Commit

Permalink
add auto update domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Lovi-0 committed Jan 20, 2024
1 parent 0709edd commit 71f7f42
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
20 changes: 1 addition & 19 deletions Src/Api/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,7 @@
from Src.Util.Helper.console import console

# General import
import requests, json, sys
from bs4 import BeautifulSoup

def get_version(domain):

try:
r = requests.get(f'https://streamingcommunity.{domain}/', headers={
'Authority': f'streamingcommunity.{domain}',
'User-Agent': get_headers(),
})
soup = BeautifulSoup(r.text, "lxml")
info_data_page = soup.find("div", {'id': 'app'}).attrs["data-page"]

return json.loads(info_data_page)['version']

except:
console.log("[red]UPDATE DOMANIN")
sys.exit(0)

import requests, sys

def search(title_search, domain):

Expand Down
2 changes: 1 addition & 1 deletion Src/Upload/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'Streaming_community'
__version__ = 'v0.7.8'
__version__ = 'v0.8.0'
__author__ = 'Ghost6446'
__description__ = 'A command-line program to download film'
__license__ = 'MIT License'
Expand Down
8 changes: 5 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
from Src.Upload.update import main_update

# General import
import sys
import sys, requests


# Variable
domain = "cz"
site_version = Page.get_version(domain)
json_data = requests.get("https://raw.githubusercontent.com/Ghost6446/Streaming_comunity_data/main/data.json").json()
domain = json_data['domain']
site_version = json_data['version']

def main():

Expand Down

0 comments on commit 71f7f42

Please sign in to comment.