Compare commits

...

4 commits

Author SHA1 Message Date
2096898fd1
Update README.md 2024-02-01 16:19:43 -05:00
e573927a11
Update README.md 2024-02-01 16:18:59 -05:00
9eab74f47a
Merge pull request #1 from ethanrusz/handle-shorts
Add YouTube Shorts Support
2024-02-01 15:12:07 -06:00
ad9a56a420
Handle YouTube shorts. 2024-02-01 16:08:01 -05:00
2 changed files with 16 additions and 1 deletions

View file

@ -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
View file

@ -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)