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