force update

This commit is contained in:
TylerCG 2025-04-29 17:04:32 -04:00
parent ef7a17ffb1
commit ff4e9ca614
2 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ class grab():
seasons = [item.replace(url+'/season:', '') for item in option_values]
return seasons
def poster(url, name, save_dir='/data/posters/', force_download=False):
def poster(url, name, force_download, save_dir='/data/posters/'):
# Use alt for filename if available, fallback to a generic name
alt_value = name
path = urlsplit(url).path
@ -174,7 +174,7 @@ class dropout():
ydl.download([entry['webpage_url']])
def series():
def series(force_download):
json_data=[]
html=requests.get('https://www.dropout.tv/series').text
@ -200,7 +200,7 @@ class dropout():
info_data['SHOW'] = show.get('alt', 'No title')
info_data['URL'] = show.get('href', 'No link')
info_data['LINK'] = re.sub(r".*dropout.tv/", "", show.get('href', ''))
info_data['POSTER'] = grab.poster(show.get('src', ''), show.get('alt', ''))
info_data['POSTER'] = grab.poster(show.get('src', ''), show.get('alt', ''),force_download)
json_data.append(info_data)
# Sort the json_data by the 'SHOW' key

View File

@ -21,10 +21,10 @@ cached_data = None
# api
@app.get("/dropout/update")
async def dropoutUpdate():
async def dropoutUpdate(force: str = True):
global cached_data
try:
download.dropout.series()
download.dropout.series(force)
with open('/data/dropout.json') as f:
cached_data = json.load(f)
return JSONResponse(status_code=200, content={"status": "success", "message": "Series grab complete."})