cutter: Get video link from backend instead of hard-coding youtube

pull/114/head
Mike Lang 5 years ago
parent 12decf015e
commit ba53172cbc

@ -350,7 +350,7 @@ class Cutter(object):
# from requests.post() are not recoverable. # from requests.post() are not recoverable.
try: try:
video_id = upload_backend.upload_video( video_id, video_link = upload_backend.upload_video(
title=( title=(
"{} - {}".format(self.title_header, job.video_title) "{} - {}".format(self.title_header, job.video_title)
if self.title_header else job.video_title if self.title_header else job.video_title
@ -418,8 +418,7 @@ class Cutter(object):
# Success! Set TRANSCODING or DONE and clear any previous error. # Success! Set TRANSCODING or DONE and clear any previous error.
success_state = 'TRANSCODING' if upload_backend.needs_transcode else 'DONE' success_state = 'TRANSCODING' if upload_backend.needs_transcode else 'DONE'
link = "https://youtu.be/{}".format(video_id) if not set_row(state=success_state, video_id=video_id, video_link=video_link, error=None):
if not set_row(state=success_state, video_id=video_id, video_link=link, error=None):
# This will result in it being stuck in FINALIZING, and an operator will need to go # This will result in it being stuck in FINALIZING, and an operator will need to go
# confirm it was really uploaded. # confirm it was really uploaded.
raise JobConsistencyError( raise JobConsistencyError(
@ -427,7 +426,7 @@ class Cutter(object):
.format(job.id, self.name, success_state) .format(job.id, self.name, success_state)
) )
self.logger.info("Successfully cut and uploaded job {} as {}".format(format_job(job), link)) self.logger.info("Successfully cut and uploaded job {} as {}".format(format_job(job), video_link))
videos_uploaded.labels(video_channel=job.video_channel, videos_uploaded.labels(video_channel=job.video_channel,
video_quality=job.video_quality, video_quality=job.video_quality,
upload_location=job.upload_location).inc() upload_location=job.upload_location).inc()

Loading…
Cancel
Save