|
|
@ -2056,7 +2056,7 @@ def titre(room, event): # cherche le titre d'une page |
|
|
|
else: |
|
|
|
msg(room,"Titre non trouvé",event['sender']) |
|
|
|
if (re.search(r"http[s]?://(www\.)?youtube\.",url) is not None and modules[room.room_id, 'invidious'] is False and not event['sender'] == bot.client.user_id): |
|
|
|
res = re.sub(r"^.*\?v=([^&]*).*$", r"\1", url) |
|
|
|
res = re.sub(r"^.*\?v=(\w+).*$", r"\1", url) |
|
|
|
msg(room,str("https://invidious.fdn.fr/watch?v=" + res),event['sender']) |
|
|
|
except: |
|
|
|
msg(room,"URL invalide",event['sender']) |
|
|
@ -2071,7 +2071,7 @@ def invidious(room, event): # convertit un lien youtube en lien invidious |
|
|
|
if (modules[room.room_id, 'invidious'] and not event['sender'] == bot.client.user_id): |
|
|
|
url = event['content']['body'] |
|
|
|
try: |
|
|
|
res = re.sub(r"^.*\?v=([^& ]*).*$", r"\1", url) |
|
|
|
res = re.sub(r"^.*\?v=(\w+).*$", r"\1", url) |
|
|
|
msg(room,str("Une alternative pour cette video : https://invidious.fdn.fr/watch?v=" + res),event['sender']) |
|
|
|
except: |
|
|
|
msg(room,"URL invalide",event['sender']) |
|
|
|