Skip to content

Commit

Permalink
style: format unformatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
mariugul committed Aug 11, 2024
1 parent 59e0de1 commit 04652b3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions karaoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 04652b3

Please sign in to comment.