From 9dd1e9a29fb42698f7aff6bdcb20d8778b18f4d3 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 24 May 2022 10:44:18 +0700 Subject: [PATCH] extract playlists with new YtBase class --- tubearchivist/home/src/index/channel.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tubearchivist/home/src/index/channel.py b/tubearchivist/home/src/index/channel.py index 06d0086c..ec8c0af1 100644 --- a/tubearchivist/home/src/index/channel.py +++ b/tubearchivist/home/src/index/channel.py @@ -10,10 +10,10 @@ import re from datetime import datetime import requests -import yt_dlp from bs4 import BeautifulSoup from home.src.download import queue # partial import from home.src.download.thumbnails import ThumbManager +from home.src.download.yt_dlp_base import YtWrap from home.src.es.connect import ElasticWrap, IndexPaginate from home.src.index.generic import YouTubeItem from home.src.index.playlist import YoutubePlaylist @@ -314,12 +314,8 @@ class YoutubeChannel(YouTubeItem): f"https://www.youtube.com/channel/{self.youtube_id}" + "/playlists?view=1&sort=dd&shelf_id=0" ) - obs = { - "quiet": True, - "skip_download": True, - "extract_flat": True, - } - playlists = yt_dlp.YoutubeDL(obs).extract_info(url) + obs = {"skip_download": True, "extract_flat": True} + playlists = YtWrap(obs).extract(url) all_entries = [(i["id"], i["title"]) for i in playlists["entries"]] self.all_playlists = all_entries