mirror of
https://github.com/ethanrusz/youtube-url-corrector.git
synced 2025-04-12 05:26:33 -04:00
Compare commits
4 commits
08557106b4
...
2096898fd1
Author | SHA1 | Date | |
---|---|---|---|
2096898fd1 | |||
e573927a11 | |||
9eab74f47a | |||
ad9a56a420 |
2 changed files with 16 additions and 1 deletions
15
README.md
15
README.md
|
@ -1,2 +1,15 @@
|
|||
# youtube-url-corrector
|
||||
A Python bot to redirect YouTube links to Piped.
|
||||
A Python based Discord bot to redirect YouTube links to Piped.
|
||||
|
||||
Example `compose.yml`
|
||||
```yml
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
bot:
|
||||
image: git.beans.team/em/yuc:latest
|
||||
environment:
|
||||
- DISCORD_TOKEN=your_discord_bot_token
|
||||
- PIPED_URL=https://your.piped.url/watch?v=
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
|
2
bot.py
2
bot.py
|
@ -52,6 +52,8 @@ async def get_youtube_id(url: str, ignore_playlist=True) -> str:
|
|||
return query.path.split('/')[2]
|
||||
if query.path[:3] == '/v/':
|
||||
return query.path.split('/')[2]
|
||||
if query.path[:8] == '/shorts/':
|
||||
return query.path.split('/')[1]
|
||||
|
||||
|
||||
bot.run(DISCORD_TOKEN)
|
||||
|
|
Loading…
Add table
Reference in a new issue