Catch ChannelNotFound exception while updating db.
This commit is contained in:
parent
795aacb044
commit
41c6a344fa
1 changed files with 4 additions and 1 deletions
|
@ -98,7 +98,10 @@ def upgrade_4_to_5(ycdldb):
|
||||||
rows = ycdldb.sql.execute('SELECT id FROM channels').fetchall()
|
rows = ycdldb.sql.execute('SELECT id FROM channels').fetchall()
|
||||||
channels = [row[0] for row in rows]
|
channels = [row[0] for row in rows]
|
||||||
for channel in channels:
|
for channel in channels:
|
||||||
|
try:
|
||||||
uploads_playlist = ycdldb.youtube.get_user_uploads_playlist_id(channel)
|
uploads_playlist = ycdldb.youtube.get_user_uploads_playlist_id(channel)
|
||||||
|
except ycdl.ytapi.ChannelNotFound:
|
||||||
|
continue
|
||||||
print(f'{channel} has playlist {uploads_playlist}.')
|
print(f'{channel} has playlist {uploads_playlist}.')
|
||||||
ycdldb.sql.execute(
|
ycdldb.sql.execute(
|
||||||
'UPDATE channels SET uploads_playlist = ? WHERE id = ?',
|
'UPDATE channels SET uploads_playlist = ? WHERE id = ?',
|
||||||
|
|
Loading…
Reference in a new issue