diff --git a/files/routes/chats.py b/files/routes/chats.py index c549a9ca5..38cbddf67 100644 --- a/files/routes/chats.py +++ b/files/routes/chats.py @@ -213,7 +213,9 @@ def schedule_orgy(v, chat_id): if bare_youtube_regex.match(normalized_link): orgy_type = 'youtube' data, _ = get_youtube_id_and_t(normalized_link) - if YOUTUBE_KEY != DEFAULT_CONFIG_VALUE: + if YOUTUBE_KEY == DEFAULT_CONFIG_VALUE: + data = f'https://cdpn.io/pen/debug/NWeVNRj?v={data}&autoplay=1' + else: req = requests.get(f"https://www.googleapis.com/youtube/v3/videos?id={data}&key={YOUTUBE_KEY}&part=contentDetails", headers=HEADERS, timeout=5).json() duration = req['items'][0]['contentDetails']['duration'] if duration != 'P0D': @@ -238,6 +240,7 @@ def schedule_orgy(v, chat_id): elif twitch_regex.match(normalized_link): orgy_type = 'twitch' data = twitch_regex.search(normalized_link).group(3) + data = f'https://player.twitch.tv/?channel={data}&parent={SITE}' elif any((normalized_link.lower().endswith(f'.{x}') for x in VIDEO_FORMATS)): domain = tldextract.extract(normalized_link).registered_domain if domain != 'archive.org' and not is_safe_url(normalized_link): @@ -269,12 +272,12 @@ def schedule_orgy(v, chat_id): ma = ModAction( kind="schedule_orgy", user_id=v.id, - _note=f'{title}', + _note=f'{title}', ) g.db.add(ma) if AEVANN_ID and v.id != AEVANN_ID: - text = f"@{v.username} has started [{title}]({normalized_link}) in [{chat.name}](/chat/{chat.id})" + text = f"@{v.username} has started [{title}]({orgy.data}) in [{chat.name}](/chat/{chat.id})" send_repeatable_notification(AEVANN_ID, text) return redirect(f"/chat/{chat_id}/orgies") diff --git a/files/templates/orgy.html b/files/templates/orgy.html index ce149e147..0795cc2c8 100644 --- a/files/templates/orgy.html +++ b/files/templates/orgy.html @@ -23,15 +23,13 @@

{% if orgy.type == 'youtube' %} - - {% elif orgy.type == 'rumble' %} - - {% elif orgy.type == 'twitch' %} - + {% elif orgy.type == 'file' %} + {% else %} + {% endif %}

{% if (orgies)|length > 1 %}