added response
This commit is contained in:
parent
819bcedd31
commit
abc74fb307
@ -78,6 +78,7 @@ class dropout():
|
|||||||
|
|
||||||
def series():
|
def series():
|
||||||
json_data=[]
|
json_data=[]
|
||||||
|
try:
|
||||||
page_html=requests.get('https://www.dropout.tv/series')
|
page_html=requests.get('https://www.dropout.tv/series')
|
||||||
# If you want to parse the HTML
|
# If you want to parse the HTML
|
||||||
soup = BeautifulSoup(page_html.text, 'html.parser')
|
soup = BeautifulSoup(page_html.text, 'html.parser')
|
||||||
@ -96,9 +97,11 @@ class dropout():
|
|||||||
|
|
||||||
# Sort the json_data by the 'SHOW' key
|
# Sort the json_data by the 'SHOW' key
|
||||||
sorted_json_data = sorted(json_data, key=lambda x: x['SHOW'])
|
sorted_json_data = sorted(json_data, key=lambda x: x['SHOW'])
|
||||||
|
|
||||||
with open('/data/dropout.json', 'w') as json_file:
|
with open('/data/dropout.json', 'w') as json_file:
|
||||||
json.dump(sorted_json_data, json_file, indent=4)
|
json.dump(sorted_json_data, json_file, indent=4)
|
||||||
|
return JSONResponse(status_code=200, content={"status": "success", "message": "Series information gather successfully."})
|
||||||
|
except Exception as e:
|
||||||
|
return JSONResponse(status_code=500, content={"status": "error", "message": str(e)})
|
||||||
|
|
||||||
class youtube():
|
class youtube():
|
||||||
def ydl(url, location):
|
def ydl(url, location):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user