mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 19:09:29 +00:00
return complete vid_entry dict from scan
This commit is contained in:
@@ -510,12 +510,14 @@ class ChannelFullScan:
|
||||
self.to_update = []
|
||||
for video in all_local_videos:
|
||||
video_id = video["youtube_id"]
|
||||
remote_match = [i for i in all_remote_videos if i[0] == video_id]
|
||||
remote_match = [
|
||||
i for i in all_remote_videos if i["id"] == video_id
|
||||
]
|
||||
if not remote_match:
|
||||
print(f"{video_id}: no remote match found")
|
||||
continue
|
||||
|
||||
expected_type = remote_match[0][-1]
|
||||
expected_type = remote_match[0]["vid_type"]
|
||||
if video["vid_type"] != expected_type:
|
||||
self.to_update.append(
|
||||
{
|
||||
|
||||
@@ -258,8 +258,8 @@ class PendingList(PendingIndex):
|
||||
video_results = ChannelSubscription().get_last_youtube_videos(
|
||||
url, limit=False, query_filter=vid_type
|
||||
)
|
||||
for video_id, _, vid_type in video_results:
|
||||
self._add_video(video_id, vid_type)
|
||||
for video_entry in video_results:
|
||||
self._add_video(video_entry["id"], video_entry["vid_type"])
|
||||
|
||||
def _parse_playlist(self, url):
|
||||
"""add all videos of playlist to list"""
|
||||
|
||||
@@ -65,12 +65,9 @@ class ChannelSubscription:
|
||||
if not channel_query:
|
||||
continue
|
||||
|
||||
last_videos.extend(
|
||||
[
|
||||
(i["id"], i["title"], vid_type)
|
||||
for i in channel_query["entries"]
|
||||
]
|
||||
)
|
||||
for entry in channel_query["entries"]:
|
||||
entry["vid_type"] = vid_type
|
||||
last_videos.append(entry)
|
||||
|
||||
return last_videos
|
||||
|
||||
@@ -93,7 +90,9 @@ class ChannelSubscription:
|
||||
|
||||
if last_videos:
|
||||
ids_to_add = is_missing([i[0] for i in last_videos])
|
||||
for video_id, _, vid_type in last_videos:
|
||||
for video_entry in last_videos:
|
||||
video_id = video_entry["id"]
|
||||
vid_type = video_entry["vid_type"]
|
||||
if video_id in ids_to_add:
|
||||
missing_videos.append((video_id, vid_type))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user