mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-10 01:10:31 +00:00
extract playlists with new YtBase class
This commit is contained in:
parent
3f5104d6d8
commit
9dd1e9a29f
@ -10,10 +10,10 @@ import re
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import yt_dlp
|
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from home.src.download import queue # partial import
|
from home.src.download import queue # partial import
|
||||||
from home.src.download.thumbnails import ThumbManager
|
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.es.connect import ElasticWrap, IndexPaginate
|
||||||
from home.src.index.generic import YouTubeItem
|
from home.src.index.generic import YouTubeItem
|
||||||
from home.src.index.playlist import YoutubePlaylist
|
from home.src.index.playlist import YoutubePlaylist
|
||||||
@ -314,12 +314,8 @@ class YoutubeChannel(YouTubeItem):
|
|||||||
f"https://www.youtube.com/channel/{self.youtube_id}"
|
f"https://www.youtube.com/channel/{self.youtube_id}"
|
||||||
+ "/playlists?view=1&sort=dd&shelf_id=0"
|
+ "/playlists?view=1&sort=dd&shelf_id=0"
|
||||||
)
|
)
|
||||||
obs = {
|
obs = {"skip_download": True, "extract_flat": True}
|
||||||
"quiet": True,
|
playlists = YtWrap(obs).extract(url)
|
||||||
"skip_download": True,
|
|
||||||
"extract_flat": True,
|
|
||||||
}
|
|
||||||
playlists = yt_dlp.YoutubeDL(obs).extract_info(url)
|
|
||||||
all_entries = [(i["id"], i["title"]) for i in playlists["entries"]]
|
all_entries = [(i["id"], i["title"]) for i in playlists["entries"]]
|
||||||
self.all_playlists = all_entries
|
self.all_playlists = all_entries
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user