Skip to content

Commit

Permalink
fix code style in youtube_client
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Sep 21, 2024
1 parent 905e56b commit 4f1dce0
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions voctopublish/api_client/youtube_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from model.ticket_module import Ticket
from tools.thumbnails import ThumbnailGenerator

LOG = logging.getLogger('YoutubeAPI')
LOG = logging.getLogger("YoutubeAPI")


class YoutubeAPI:
Expand Down Expand Up @@ -131,9 +131,7 @@ def publish(self):
)
out_path = os.path.join(self.t.publishing_path, out_filename)

LOG.info(
"remuxing " + self.t.local_filename + " to " + out_path
)
LOG.info("remuxing " + self.t.local_filename + " to " + out_path)

try:
subprocess.check_output(
Expand Down Expand Up @@ -228,15 +226,17 @@ def upload(self, file, lang):
" ".join(topline),
]
if self.t.voctoweb_enable:
description_components.insert(0, f"{self.config['voctoweb']['frontend_url']}/v/{self.t.slug}")
description_components.insert(
0, f"{self.config['voctoweb']['frontend_url']}/v/{self.t.slug}"
)

license = "youtube"
if self.t.license:
if "https://creativecommons.org/licenses/by" in self.t.license:
license = "creativeCommon"
description_components.append(self.t.license)

LOG.debug(f"{description_components=}"
LOG.debug(f"{description_components=}")

description = ""
for item in description_components:
Expand Down Expand Up @@ -307,7 +307,9 @@ def upload(self, file, lang):
},
data=metadata_json,
)
LOG.info(f"Request to create youtube video yielded status code {r.status_code}: {r.text}")
LOG.info(
f"Request to create youtube video yielded status code {r.status_code}: {r.text}"
)
LOG.debug(f"{r.headers=}")

if 200 != r.status_code:
Expand Down Expand Up @@ -426,9 +428,7 @@ def _build_title(self, lang=None):
if title_suffix:
title_suffix = self._replace_language_placeholders(title_suffix, language)
title = title + " " + title_suffix
LOG.debug(
f"adding '{title_suffix}' as title suffix, new title: {title}"
)
LOG.debug(f"adding '{title_suffix}' as title suffix, new title: {title}")

if (
lang
Expand Down Expand Up @@ -531,9 +531,7 @@ def depublish(self):
video_id,
{"id": video_id, "status": {"privacyStatus": "private"}},
)
LOG.info(
"depublished %s video track from %s" % (lang, video_url)
)
LOG.info("depublished %s video track from %s" % (lang, video_url))
depublished_urls.append(video_url)
props[f"YouTube.Url{i}"] = ""

Expand Down

0 comments on commit 4f1dce0

Please sign in to comment.