From 04652b32db7264da1e5344d3369d6ae3c6521536 Mon Sep 17 00:00:00 2001 From: mariugul Date: Thu, 8 Aug 2024 01:26:01 +0200 Subject: [PATCH] style: format unformatted code --- karaoke.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/karaoke.py b/karaoke.py index 01bb0c1c..c2da65cc 100644 --- a/karaoke.py +++ b/karaoke.py @@ -17,8 +17,13 @@ from unidecode import unidecode from lib.file_resolver import FileResolver -from lib.get_platform import (get_ffmpeg_version, get_os_version, get_platform, - is_raspberry_pi, supports_hardware_h264_encoding) +from lib.get_platform import ( + get_ffmpeg_version, + get_os_version, + get_platform, + is_raspberry_pi, + supports_hardware_h264_encoding, +) # Support function for reading lines from ffmpeg stderr without blocking @@ -367,13 +372,13 @@ def find_song_by_youtube_id(self, youtube_id): return None def get_youtube_id_from_url(self, url): - if "v=" in url: #accomodates youtube.com/watch?v= and m.youtube.com/?v= + if "v=" in url: # accomodates youtube.com/watch?v= and m.youtube.com/?v= s = url.split("watch?v=") - else: #accomodates youtu.be/ + else: # accomodates youtu.be/ s = url.split("u.be/") if len(s) == 2: - if "?" in s[1]: #Strip uneeded Youtube Params - s[1] = s[1][0: s[1].index('?')] + if "?" in s[1]: # Strip uneeded Youtube Params + s[1] = s[1][0 : s[1].index("?")] return s[1] else: logging.error("Error parsing youtube id from url: " + url)