feat: add catalog
This commit is contained in:
@@ -6,23 +6,12 @@ from aiocache import cached
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from gallery.sketch.schedule.api import ScheduleApi
|
||||
from gallery.sketch.schedule.catalog import ChannelId
|
||||
from gallery.sketch.schedule.model import Channel, Schedule, ScheduleValue
|
||||
|
||||
logger = logging.getLogger("matchtv")
|
||||
|
||||
|
||||
CHANNEL_LIST = [
|
||||
"matchtv",
|
||||
"igra",
|
||||
"arena",
|
||||
"futbol-1",
|
||||
"futbol-2",
|
||||
"futbol-3",
|
||||
"strana",
|
||||
# "planeta",
|
||||
]
|
||||
|
||||
|
||||
class MatchTvApi(ScheduleApi):
|
||||
BASE_URL = "https://matchtv.ru"
|
||||
CACHE_TTL = 30 * 60
|
||||
@@ -46,7 +35,15 @@ class MatchTvApi(ScheduleApi):
|
||||
return await response.text()
|
||||
|
||||
async def get_channels(self) -> list[str]:
|
||||
return CHANNEL_LIST
|
||||
return [
|
||||
ChannelId.MATCH_TV,
|
||||
ChannelId.MATCH_IGRA,
|
||||
ChannelId.MATCH_ARENA,
|
||||
ChannelId.MATCH_FUTBOL_1,
|
||||
ChannelId.MATCH_FUTBOL_2,
|
||||
ChannelId.MATCH_FUTBOL_3,
|
||||
ChannelId.MATCH_STRANA,
|
||||
]
|
||||
|
||||
@cached(ttl=CACHE_TTL)
|
||||
async def get_channel_schedule(
|
||||
|
||||
Reference in New Issue
Block a user