mirror of
https://github.com/ovosimpatico/CLI-TikTok.git
synced 2026-01-15 11:52:52 -03:00
Initial work into optional settings
Moved proxitok_instance to OPTIONS Signed-off-by: nanometer5088 <code.deleo@simplelogin.com>
This commit is contained in:
@@ -19,7 +19,7 @@ def streamuser(username):
|
||||
|
||||
|
||||
def proxitok_scraper(username: str) -> list[str]:
|
||||
from src.constants import APP
|
||||
from src.constants import OPTIONS
|
||||
log("Scraper started")
|
||||
print("\nObtaining URLs - this can take a while with users with many posts.")
|
||||
session = requests.Session()
|
||||
@@ -27,7 +27,7 @@ def proxitok_scraper(username: str) -> list[str]:
|
||||
next_href = ""
|
||||
rate_limit = 0
|
||||
while True:
|
||||
url = f"{APP['proxitok_instance']}/@{username}{next_href}"
|
||||
url = f"{OPTIONS['proxitok_instance']}/@{username}{next_href}"
|
||||
response = session.get(url)
|
||||
log(f"Scraping {url}")
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# Do not change anything here
|
||||
APP = {
|
||||
"name": "CLI TikTok",
|
||||
"proxitok_instance": "https://proxitok.pabloferreiro.es",
|
||||
"version": 0.80
|
||||
"version": 0.81
|
||||
}
|
||||
|
||||
|
||||
# Here are the app settings. You are free to configure this field
|
||||
OPTIONS = {
|
||||
"proxitok_instance": "https://proxitok.pabloferreiro.es"
|
||||
}
|
||||
@@ -22,7 +22,7 @@ def streamtrending(amount:int = 24):
|
||||
|
||||
|
||||
def proxitok_trending(amount: int = 24) -> list[str]:
|
||||
from src.constants import APP
|
||||
from src.constants import OPTIONS
|
||||
log("Scraper started")
|
||||
print("\nObtaining URLs - this can take a while when requesting many posts.")
|
||||
session = requests.Session()
|
||||
@@ -31,8 +31,8 @@ def proxitok_trending(amount: int = 24) -> list[str]:
|
||||
rate_limit = 0
|
||||
while True:
|
||||
# The "next" page url is always the same but loads different trending videos each time
|
||||
url = f"{APP['proxitok_instance']}/trending{next_href}"
|
||||
# url = f"https://proxitok.pussthecat.org/trending{next_href}"
|
||||
url = f"{OPTIONS['proxitok_instance']}/trending{next_href}"
|
||||
|
||||
response = session.get(url)
|
||||
log(f"Scraping {url}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user