use youtube name for file
This commit is contained in:
parent
4ecce63c83
commit
8a0c9d5539
16
README.md
16
README.md
@ -1,12 +1,26 @@
|
|||||||
# yt2podcast
|
# yt2podcast
|
||||||
|
|
||||||
## Automation
|
## Automation
|
||||||
|
|
||||||
|
## API Approach
|
||||||
- paste URL into web UI
|
- paste URL into web UI
|
||||||
- trigger download via youtube dl Material API
|
- trigger download via youtube dl Material API
|
||||||
- upload downloaded file via PodcastGenerator
|
- upload downloaded file via PodcastGenerator
|
||||||
- https://podcasts.swaghausen.de/admin/episodes_upload.php
|
- https://podcasts.swaghausen.de/admin/episodes_upload.php
|
||||||
- PHP SessId
|
- PHP SessId
|
||||||
- OR script to Edit Feed.xml and create xml associated with mp3
|
|
||||||
|
## File based approach
|
||||||
|
- paste URL into web UI
|
||||||
|
- trigger download via youtube-dl python library
|
||||||
|
|
||||||
|
### Using Podcast Generator
|
||||||
|
- downloaded file is copied to Podcast generator folder / folder is mounted as docker volume
|
||||||
|
- script to Edit Feed.xml and create xml associated with mp3
|
||||||
|
|
||||||
|
### Use Python Library to generate RSS Feed
|
||||||
|
https://github.com/lkiesow/python-feedgen
|
||||||
|
- Serve xml file via same Flask app?
|
||||||
|
|
||||||
|
|
||||||
admin
|
admin
|
||||||
test123
|
test123
|
||||||
|
@ -7,20 +7,22 @@ from flask import render_template
|
|||||||
|
|
||||||
def call_youtubedl(url):
|
def call_youtubedl(url):
|
||||||
print(url)
|
print(url)
|
||||||
download_audio(url, "first_test")
|
download_audio(url)
|
||||||
# thread = Thread(args=(, ))
|
# thread = Thread(args=(, ))
|
||||||
thread = threading.Thread(target=download_audio, args=(url, "first_test"), daemon=True)
|
thread = threading.Thread(target=download_audio, args=(url, "first_test"), daemon=True)
|
||||||
thread.start()
|
thread.start()
|
||||||
thread.join()
|
thread.join()
|
||||||
|
|
||||||
|
# loading screen based on https://github.com/Aycn0/flask_loading_screen
|
||||||
# data = "test"
|
# data = "test"
|
||||||
# return render_template('success.html', passed_data=data)
|
# return render_template('success.html', passed_data=data)
|
||||||
|
|
||||||
# print("thread finished...exiting")
|
# print("thread finished...exiting")
|
||||||
|
|
||||||
def download_audio(url, name):
|
def download_audio(url):
|
||||||
ydl_opts = {
|
ydl_opts = {
|
||||||
'format': 'bestaudio/best',
|
'format': 'bestaudio/best',
|
||||||
'outtmpl': f'/output/{name}.mp3', # Template for output names
|
'outtmpl': f'/output/%(title)s.mp3', # Template for output names. Needed to change the file extension
|
||||||
'noplaylist': True, # Download only the video, if the URL refers to a video and a playlist
|
'noplaylist': True, # Download only the video, if the URL refers to a video and a playlist
|
||||||
'continue_dl': True, # Force resume of partially downloaded files. By default, youtube-dl will resume downloads if possible
|
'continue_dl': True, # Force resume of partially downloaded files. By default, youtube-dl will resume downloads if possible
|
||||||
'postprocessors': [{
|
'postprocessors': [{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user