Skip to content

Commit

Permalink
Uploaded videos to GCloud
Browse files Browse the repository at this point in the history
  • Loading branch information
npanuhin committed Dec 16, 2023
1 parent 7a61789 commit 0f7c30f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/scripts/add_storage_url_to_videos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import sys
import os
import json

sys.path.append('../')
from gcloud import gcloud_url # noqa: E402
from utils import mkpath # noqa: E402


def main():
with open(mkpath('../../api/videos/videos.json'), 'r', encoding='utf-8') as file:
videos = json.load(file)

for item in videos:
item['url'] = gcloud_url(f'videos/source/{os.path.basename(item["path"])}')

with open(mkpath('../../api/videos/videos.json'), 'w', encoding='utf-8') as file:
json.dump(videos, file, ensure_ascii=False, indent=4)


if __name__ == '__main__':
main()
File renamed without changes.

0 comments on commit 0f7c30f

Please sign in to comment.