- drop token compilation to html - drop artlebedev typograph - drop other small things
22 lines
507 B
Python
22 lines
507 B
Python
from urllib.parse import urlparse, parse_qs
|
|
from kazimir.Token import UrlToken, is_url
|
|
|
|
|
|
class YoutubeToken(UrlToken):
|
|
@staticmethod
|
|
def test(data: str):
|
|
if not is_url(data):
|
|
return False
|
|
|
|
url = urlparse(data)
|
|
return url.netloc in ['www.youtube.com', 'youtube.com']
|
|
|
|
def __init__(self, data: str) -> None:
|
|
super().__init__(data=data)
|
|
self.name = 'youtube'
|
|
|
|
async def get_data(self):
|
|
return {
|
|
'url': self.data
|
|
}
|