https://github.com/n138-kz/youtube-bot
https://github.com/n138-kz/youtube-bot
discord discord-bot google youtube youtube-api
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/n138-kz/youtube-bot
- Owner: n138-kz
- License: mit
- Created: 2025-02-20T23:53:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-16T17:15:14.000Z (about 1 year ago)
- Last Synced: 2025-09-16T03:32:59.828Z (9 months ago)
- Topics: discord, discord-bot, google, youtube, youtube-api
- Language: Python
- Homepage: https://n138-kz.github.io/youtube_bot/
- Size: 324 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: docs/README.md
- License: LICENSE
Awesome Lists containing this project
README
# [youtube_bot](https://github.com/n138-kz/youtube_bot)
## Activity
[](/LICENSE)
[](/../../)
[](/../../)
[](/../../)
[](/../../commits)
[](/../../commits)
[](/../../commits)
[](/../../issues)
[](/../../issues)
[](/../../pulls)
[](/../../pulls)
[](/../../)
[](/../../)
## Github RestAPI
```http
GET https://api.github.com/repos/n138-kz/youtube_bot
```
[n138-kz/youtube_bot](https://api.github.com/repos/n138-kz/youtube_bot) (Public repos only)
## Discord Application
### Invite URL
[1342289249365659778](https://discord.com/oauth2/authorize?client_id=1342289249365659778)
### Public Key
```
c7a4576adcbc8907951582c419a56025c29aacd8bea7a7a42878bfdd361b27db
```
## Refs
- [Developer Console](https://console.cloud.google.com/apis/credentials?hl=ja&project=upbeat-splicer-325708)
- [Google公式リファレンス](https://developers.google.com/identity/gsi/web/guides/migration?hl=ja)
- [YouTube Data API v3](https://console.cloud.google.com/apis/api/youtube.googleapis.com/quotas?inv=1&invt=AbqMUg&project=bold-rampart-413416)
- [Developer Console](https://discord.com/developers/applications)
- [Discord公式リファレンス](https://discord.com/developers/docs/topics/oauth2)
- [discord.py APIリファレンス](https://discordpy.readthedocs.io/ja/latest/api.html)
- [OAuth2 Scopesの一覧](https://scrapbox.io/discordwiki/OAuth2_Scopes%E3%81%AE%E4%B8%80%E8%A6%A7)
- [http_post](https://github.com/n138-kz/http_post)
- [discord.pyを使用したdiscord botの作り方](https://qiita.com/TakeMimi/items/1e2d76eecc25e92c93ef#210-ver)
- [Ping値を測定](https://discordbot.jp/blog/16/)
- [Discord.py の Intents について](https://qiita.com/Erytheia/items/8b8e14f60fd7f266872b)
- [discord.py入門(1)](https://qiita.com/sizumita/items/9d44ae7d1ce007391699)
- [YouTube APIを用いてPythonでデータを取得する](https://zenn.dev/eito_blog/articles/94dc874c112c9f)
- [【Python】YouTube Data API を使って、いろんな情報を取得してみた](https://qiita.com/rkamikawa/items/dd1fd4c1427ece787eea)
- [DiscordのBotでのファイル添付の仕方など【Python】](https://qiita.com/chatrate/items/aa6625f6663fa2ca33d6)
- [)send_Discord](https://github.com/n138-kz/send_Discord)
- [Discordにwebhook経由でPOST(cURL)](https://qiita.com/n138-kz/items/7b86e3eee9d9994fc4d2)
- [【discord.py】複数ファイルを同時に送信するなど。](https://zenn.dev/milkystack/articles/35948cdfb7eb00)
## Issue client_credential (google)
1. access to [Developer Console](https://console.cloud.google.com/apis/credentials?hl=ja&project=upbeat-splicer-325708)
1. Create new project.
1. Forward to 認証情報 (left side pain)
1. Create API Key.
1. Create OAuth client_id(type=Web Application)
## Issue client_credential (discord)
1. access to [Developer Console](https://discord.com/developers/applications)
1. Create new application.
1. Reset OAuth2 information.
1. Reset bot token.
1. Turn on `Message Content Intent`

## Sample of .secret/config
```json
{
"internal":{
"local":{
"do_loop":true,
"do_sync_slash_command":true
},
"youtube":{
"notice_limit":3600,
"cycle_interval":300,
"channel_id":""
},
"discord":{
"send_message_channel":{
"on_ready":[],
"notice":[]
}
}
},
"external":{
"youtube":{
"api_key":""
},
"discord":{
"bot_token":""
}
}
}
```
|項目名|デフォルト値|説明|
|:-|:-|:-|
|`internal.local.do_loop`|`True`||
|`internal.local.do_sync_slash_command`|`True`||
|`.internal.discord.send_message_channel.on_ready`|`[]`|**起動**メッセージ送信先のチャンネルIDを整数リスト形式で記載します。|
|`.internal.discord.send_message_channel.notice`|`[]`|**通知**メッセージ送信先のチャンネルIDを整数リスト形式で記載します。|
|`.internal.youtube.cycle_interval`|300|単位: 秒(デフォルト: 5分)|
|`.internal.youtube.channel_id`||動画投稿監視チャンネルID|
|`.internal.youtube.notice_limit`|3600|単位: 秒(デフォルト: 1時間)|
|`.external.youtube.api_key`||Youtube API アクセスキー|
|`.external.discord.bot_token`||Discord API Botトークン|
## Relation
```mermaid
flowchart LR
Youtube_Data_API --> youtube_bot --> Discord
```
## Library
- python 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
- discordpy 2.5.0 (VersionInfo(major=2, minor=5, micro=0, releaselevel='final', serial=0))
- google-api-python-client 2.161.0
```sh
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
```
## License
[Copyright (c) 2025 Yuu Komiya (n138), Under MIT License](LICENSE)
[MIT_License | wikipedia](https://ja.wikipedia.org/wiki/MIT_License)
[The MIT License](https://opensource.org/license/mit/)
> [n138-kz/*](./) is licensed under the `MIT License`.
>
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
>
> `Copyright `
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[The MIT License](https://opensource.org/license/mit/)
> [n138-kz/*](./) は、MIT ライセンスに基づいてライセンスされています。
> 以下に定める条件に従い、本ソフトウェアおよび関連文書のファイル(以下「ソフトウェア」)の複製を取得するすべての人に対し、ソフトウェアを無制限に扱うことを無償で許可します。これには、ソフトウェアの複製を使用、複写、変更、結合、掲載、頒布、サブライセンス、および/または販売する権利、およびソフトウェアを提供する相手に同じことを許可する権利も無制限に含まれます。
>
> `Copyright (c) <著作権発生年> <著作権保持者名>`
>
> 上記の著作権表示および本許諾表示を、ソフトウェアのすべての複製または重要な部分に記載するものとします。
>
> ソフトウェアは「現状のまま」で、明示であるか暗黙であるかを問わず、何らの保証もなく提供されます。ここでいう保証とは、商品性、特定の目的への適合性、および権利非侵害についての保証も含みますが、それに限定されるものではありません。
> 作者または著作権者は、契約行為、不法行為、またはそれ以外であろうと、ソフトウェアに起因または関連し、あるいはソフトウェアの使用またはその他の扱いによって生じる一切の請求、損害、その他の義務について何らの責任も負わないものとします。
### Permissions / 許可
- Commercial use / 商用利用
- Modification / 改変
- Distribution / 再配布
- Private use / 私的使用
### Limitations / 制限事項
- Liability / 発生した問題に責任を負わない
- Warranty / 無保証