mirror of
https://codeberg.org/SimpleWeb/SimpleerTube.git
synced 2024-11-15 05:33:17 +00:00
Also add statuscode 200 check for latest acocunt videos
This commit is contained in:
parent
7c3d3531e8
commit
726faaa28d
7
main.py
7
main.py
|
@ -153,8 +153,13 @@ def load_subscriptions_accounts(_):
|
||||||
def get_subscriptions_accounts_videos(limit=12):
|
def get_subscriptions_accounts_videos(limit=12):
|
||||||
latest = []
|
latest = []
|
||||||
for sub in get_subscriptions_accounts():
|
for sub in get_subscriptions_accounts():
|
||||||
|
result = get_latest_account_videos(sub)
|
||||||
|
if result["status"] == 200:
|
||||||
account_latest = get_latest_account_videos(sub)["data"]
|
account_latest = get_latest_account_videos(sub)["data"]
|
||||||
latest.extend(account_latest)
|
latest.extend(account_latest)
|
||||||
|
else:
|
||||||
|
print("[WARN] Unable to get content from account " + sub)
|
||||||
|
|
||||||
latest.sort(key = lambda vid: dateutil.isoparse(vid["createdAt"]), reverse=True)
|
latest.sort(key = lambda vid: dateutil.isoparse(vid["createdAt"]), reverse=True)
|
||||||
return latest[0:limit]
|
return latest[0:limit]
|
||||||
|
|
||||||
|
@ -221,7 +226,7 @@ def get_subscriptions_channels_videos(limit=12):
|
||||||
channel_latest = get_latest_channel_videos(sub)["data"]
|
channel_latest = get_latest_channel_videos(sub)["data"]
|
||||||
latest.extend(channel_latest)
|
latest.extend(channel_latest)
|
||||||
else:
|
else:
|
||||||
print("[WARN] Unable to get content from " + sub)
|
print("[WARN] Unable to get content from channel " + sub)
|
||||||
latest.sort(key = lambda vid: dateutil.isoparse(vid["createdAt"]), reverse=True)
|
latest.sort(key = lambda vid: dateutil.isoparse(vid["createdAt"]), reverse=True)
|
||||||
return latest[0:limit]
|
return latest[0:limit]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue