mirror of
https://github.com/nova-r/fediplug.git
synced 2025-03-10 15:49:00 +01:00
parent
acddc8ee8f
commit
a5785c7eef
1 changed files with 8 additions and 1 deletions
|
@ -7,6 +7,7 @@ from lxml.etree import HTML
|
||||||
import mastodon
|
import mastodon
|
||||||
Mastodon = mastodon.Mastodon
|
Mastodon = mastodon.Mastodon
|
||||||
from youtube_dl import YoutubeDL
|
from youtube_dl import YoutubeDL
|
||||||
|
from youtube_dl.utils import DownloadError
|
||||||
|
|
||||||
class Queue(object):
|
class Queue(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -66,7 +67,13 @@ class StreamListener(mastodon.StreamListener):
|
||||||
tags = extract_tags(status)
|
tags = extract_tags(status)
|
||||||
if 'fediplay' in tags:
|
if 'fediplay' in tags:
|
||||||
links = extract_links(status)
|
links = extract_links(status)
|
||||||
self.queue.add(links[0])
|
for link in links:
|
||||||
|
try:
|
||||||
|
print('==> Trying', link)
|
||||||
|
self.queue.add(link)
|
||||||
|
return
|
||||||
|
except DownloadError:
|
||||||
|
pass
|
||||||
|
|
||||||
def register(api_base_url):
|
def register(api_base_url):
|
||||||
old_umask = umask(0o77)
|
old_umask = umask(0o77)
|
||||||
|
|
Loading…
Reference in a new issue