Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format unformatted code #364

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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