search: support podcasts and episodes

This commit is contained in:
sigma67 2023-11-11 17:05:13 +01:00
commit 6f80e94424
No known key found for this signature in database
GPG key ID: 1C314227DF0103D0
32 changed files with 175 additions and 37 deletions

View file

@ -2,12 +2,12 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: 2023-01-02 22:14+0530\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -41,6 +41,14 @@ msgstr "محطة"
msgid "profile"
msgstr "الملف الشخصي"
#: parsers/i18n.py:16
msgid "podcast"
msgstr "بودكاست"
#: parsers/i18n.py:16
msgid "episode"
msgstr "حلقة"
#: parsers/i18n.py:21
msgid "albums"
msgstr "ألبومات"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,6 +41,14 @@ msgstr ""
msgid "profile"
msgstr ""
#: parsers/i18n.py:16
msgid "podcast"
msgstr ""
#: parsers/i18n.py:16
msgid "episode"
msgstr ""
#: parsers/i18n.py:21
msgid "albums"
msgstr ""

View file

@ -2,13 +2,13 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,6 +41,14 @@ msgstr "sender"
msgid "profile"
msgstr "profil"
#: parsers/i18n.py:16
msgid "podcast"
msgstr ""
#: parsers/i18n.py:16
msgid "episode"
msgstr "Folge"
#: parsers/i18n.py:21
msgid "albums"
msgstr "alben"

View file

@ -2,13 +2,13 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,6 +41,14 @@ msgstr ""
msgid "profile"
msgstr ""
#: parsers/i18n.py:16
msgid "podcast"
msgstr ""
#: parsers/i18n.py:16
msgid "episode"
msgstr ""
#: parsers/i18n.py:21
msgid "albums"
msgstr ""

View file

@ -2,13 +2,13 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,6 +41,14 @@ msgstr "emisora"
msgid "profile"
msgstr "perfil"
#: parsers/i18n.py:16
msgid "podcast"
msgstr "Pódcast"
#: parsers/i18n.py:16
msgid "episode"
msgstr "Episodio"
#: parsers/i18n.py:21
msgid "albums"
msgstr "álbumes"

View file

@ -2,13 +2,13 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,6 +41,14 @@ msgstr "radio"
msgid "profile"
msgstr "profil"
#: parsers/i18n.py:16
msgid "podcast"
msgstr ""
#: parsers/i18n.py:16
msgid "episode"
msgstr ""
#: parsers/i18n.py:21
msgid "albums"
msgstr ""

View file

@ -2,12 +2,12 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: 2023-01-01 11:04+0530\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -41,6 +41,14 @@ msgstr "स्टेशन"
msgid "profile"
msgstr "प्रोफ़ाइल"
#: parsers/i18n.py:16
msgid "podcast"
msgstr "पॉडकास्ट"
#: parsers/i18n.py:16
msgid "episode"
msgstr "एपिसोड"
#: parsers/i18n.py:21
msgid "albums"
msgstr "एलबम"

View file

@ -2,13 +2,13 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,6 +41,14 @@ msgstr "stazione"
msgid "profile"
msgstr "profilo"
#: parsers/i18n.py:16
msgid "podcast"
msgstr ""
#: parsers/i18n.py:16
msgid "episode"
msgstr "Puntata"
#: parsers/i18n.py:21
msgid "albums"
msgstr "album"

View file

@ -2,13 +2,13 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,6 +41,14 @@ msgstr "ステーション"
msgid "profile"
msgstr "プロフィール"
#: parsers/i18n.py:16
msgid "podcast"
msgstr "ポッドキャスト"
#: parsers/i18n.py:16
msgid "episode"
msgstr "エピソード"
#: parsers/i18n.py:21
msgid "albums"
msgstr "アルバム"

View file

@ -2,13 +2,13 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,6 +41,14 @@ msgstr "스테이션"
msgid "profile"
msgstr "프로필"
#: parsers/i18n.py:16
msgid "podcast"
msgstr "팟캐스트"
#: parsers/i18n.py:16
msgid "episode"
msgstr "에피소드"
#: parsers/i18n.py:21
msgid "albums"
msgstr "앨범"

View file

@ -2,12 +2,12 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: 2023-04-23 14:55+0200\n"
"Last-Translator: Heimen Stoffels <vistausss@fastmail.com>\n"
"Language-Team: \n"
@ -42,6 +42,14 @@ msgstr "station"
msgid "profile"
msgstr "profiel"
#: parsers/i18n.py:16
msgid "podcast"
msgstr ""
#: parsers/i18n.py:16
msgid "episode"
msgstr "Aflevering"
#: parsers/i18n.py:21
msgid "albums"
msgstr "albums"

View file

@ -2,12 +2,12 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: 2023-01-01 12:15+0530\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -41,6 +41,14 @@ msgstr "estação"
msgid "profile"
msgstr "perfil"
#: parsers/i18n.py:16
msgid "podcast"
msgstr ""
#: parsers/i18n.py:16
msgid "episode"
msgstr "Episódio"
#: parsers/i18n.py:21
msgid "albums"
msgstr "álbuns"

View file

@ -2,12 +2,12 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: 2023-01-01 09:48+0530\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -41,6 +41,14 @@ msgstr "станция"
msgid "profile"
msgstr "профиль"
#: parsers/i18n.py:16
msgid "podcast"
msgstr "Подкаст"
#: parsers/i18n.py:16
msgid "episode"
msgstr "Выпуск"
#: parsers/i18n.py:21
msgid "albums"
msgstr "альбомы"

View file

@ -2,12 +2,12 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: 2023-01-02 13:06+0530\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -41,6 +41,14 @@ msgstr "istasyon"
msgid "profile"
msgstr "profil"
#: parsers/i18n.py:16
msgid "podcast"
msgstr ""
#: parsers/i18n.py:16
msgid "episode"
msgstr "Bölüm"
#: parsers/i18n.py:21
msgid "albums"
msgstr "albümler"

View file

@ -2,12 +2,12 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: 2023-01-02 22:18+0530\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -41,6 +41,14 @@ msgstr "اسٹیشن"
msgid "profile"
msgstr "پروفائ"
#: parsers/i18n.py:16
msgid "podcast"
msgstr "پوڈکاسٹ"
#: parsers/i18n.py:16
msgid "episode"
msgstr "ایپی سوڈ"
#: parsers/i18n.py:21
msgid "albums"
msgstr "البمز"

View file

@ -2,12 +2,12 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Bruce Zhang <zttt183525594@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -40,6 +40,14 @@ msgstr "电台"
msgid "profile"
msgstr "个人资料"
#: parsers/i18n.py:16
msgid "podcast"
msgstr "播客"
#: parsers/i18n.py:16
msgid "episode"
msgstr "分集"
#: parsers/i18n.py:21
msgid "albums"
msgstr "专辑"

View file

@ -2,13 +2,13 @@
# Copyright (C) 2023 sigma67
# This file is distributed under the same license as ytmusicapi
# sigma67 <ytmusicapi@gmail.com>
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-20 16:00+0200\n"
"POT-Creation-Date: 2023-11-11 16:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,6 +41,14 @@ msgstr "電台"
msgid "profile"
msgstr "個人資料"
#: parsers/i18n.py:16
msgid "podcast"
msgstr ""
#: parsers/i18n.py:16
msgid "episode"
msgstr "單集"
#: parsers/i18n.py:21
msgid "albums"
msgstr "專輯"

View file

@ -135,7 +135,7 @@ class SearchMixin:
search_results = []
filters = [
'albums', 'artists', 'playlists', 'community_playlists', 'featured_playlists', 'songs',
'videos', 'profiles'
'videos', 'profiles', 'podcasts', 'episodes'
]
if filter and filter not in filters:
raise Exception(

View file

@ -13,7 +13,7 @@ class Parser:
@i18n
def get_search_result_types(self):
return [_('artist'), _('playlist'), _('song'), _('video'), _('station'), _('profile')]
return [_('artist'), _('playlist'), _('song'), _('video'), _('station'), _('profile'), _('podcast'), _('episode')]
@i18n
def parse_artist_contents(self, results: List) -> Dict:

View file

@ -5,7 +5,7 @@ from ._utils import *
def get_search_result_type(result_type_local, result_types_local):
if not result_type_local:
return None
result_types = ['artist', 'playlist', 'song', 'video', 'station', 'profile']
result_types = ['artist', 'playlist', 'song', 'video', 'station', 'profile', 'podcast', 'episode']
result_type_local = result_type_local.lower()
# default to album since it's labeled with multiple values ('Single', 'EP', etc.)
if result_type_local not in result_types_local:
@ -207,7 +207,9 @@ def _get_param2(filter):
'albums': 'IY',
'artists': 'Ig',
'playlists': 'Io',
'profiles': 'JY'
'profiles': 'JY',
'podcasts': 'JQ',
'episodes': 'JI'
}
return filter_params[filter]