Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ cython_debug/
uv.lock
.python-version
client_secret.json
token.pickle
token*.pickle
*.xlsx
thumbnails/*.png
thumbnails/*.zip
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ YouTube 動画を API 経由で設定する
- 動画のステイタスを変更する
- `python set_youtube_status.py EXCEL_FILENAME`
- Excel ファイルには以下のカラムが必要
- Check ・・使っていない
- Video ID
- Status ・・ `public` or `private`, `unlisted` を入れる
- 動画のサムネイルを入れる
Expand Down
2 changes: 1 addition & 1 deletion get_youtube_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def main():
# pprint(playlist_id)

#
playlist_id = "PLMkWB0UjwFGmeCsQBaDYh1pcoDdSXaCQG"
playlist_id = "PLMkWB0UjwFGmjkZ_yH6Mr3853R8HINm-X" # PyCon JP 2025

next_page_token = ""
items = []
Expand Down
6 changes: 3 additions & 3 deletions set_youtube_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ def get_youtube_service():
return service


def set_video_status(service, video_id: str, status: str):
def set_video_status(service, video_id: str, status: str, license: str = "creativeCommon"):
request = service.videos().update(
part="status",
body={"id": video_id, "status": {"privacyStatus": status}},
body={"id": video_id, "status": {"privacyStatus": status, "license": license}},
)
response = request.execute()
return response
Expand All @@ -84,7 +84,7 @@ def get_video_list_from_xlsx(filename: str) -> Generator[YoutubeVideo, None, Non
for row in ws.iter_rows(min_row=2, values_only=True):
if not row[0]:
continue
video = YoutubeVideo(row[1], row[2])
video = YoutubeVideo(row[0], row[1])
yield video


Expand Down