Skip to content

Commit

Permalink
added some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cisvhat committed Feb 10, 2024
1 parent 34605cf commit 188a606
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
14 changes: 4 additions & 10 deletions generate_and_upload_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ def upload_video(youtube, file, title, description, category, keywords, privacyS
num_ideas = 5

youtube = get_authenticated_service()
category = os.getenv(
"CATEGORY"
) # YouTube category ID (e.g., "22" represents People & Blogs category)
privacyStatus = os.getenv("PRIVACY_STATUS") # public, private, or unlisted
category = os.getenv("CATEGORY")
privacyStatus = os.getenv("PRIVACY_STATUS")

ideas = generate_ideas(meta_topic, num_ideas)
print(colored("[+] Generating ideas...", "yellow")) # Progress message
Expand All @@ -84,15 +82,11 @@ def upload_video(youtube, file, title, description, category, keywords, privacyS
for idea in ideas["ideas"]:
video_subject = idea
output_file_path = f"./output/{video_subject}.mp4"
video_path, updated_clips = topic2video(
video_subject, num_clips, output_file_path
)
video_path, updated_clips = topic2video(video_subject, num_clips, output_file_path)

description = updated_clips["description"]
keywords = updated_clips["topic"]
category = updated_clips["category"]

title = updated_clips["title"]
upload_video(
youtube, video_path, title, description, category, keywords, privacyStatus
)
upload_video(youtube, video_path, title, description, category, keywords, privacyStatus)
4 changes: 4 additions & 0 deletions generate_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,18 @@ def topic2video(video_subject, num_clips, output_file_path):


if __name__ == "__main__":
# どのような動画を作成するか大まかに指定
meta_topic = "科学に関する話題を具体的に。"
# 何本の動画アイデアを生成するか指定
num_ideas = 3
ideas = generate_ideas(meta_topic, num_ideas)
print(colored("[+] Generating ideas...", "yellow"))
print(ideas)

# アイデアの数だけ動画を生成、具体的なトピックはgpt APIで生成
for idea in ideas["ideas"]:
video_subject = idea
# 1動画あたりのクリップ数
num_clips = 5
output_file_path = f"./output/{video_subject}.mp4"
video_path, updated_clips = topic2video(
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
termcolor
openai
pytest
black
pydub
requests
google-api-python-client
Expand Down

0 comments on commit 188a606

Please sign in to comment.