-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MVP (hooray 😄🎉) (yet more is to be done)
- Loading branch information
Showing
6 changed files
with
63 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,6 @@ | ||
import sys | ||
from yt_dlp import YoutubeDL | ||
|
||
|
||
def download_videos(urls): | ||
# if not urls or not isinstance(urls, list): | ||
# # Rick Astley - Never Gonna Give You Up (Official Music Video) | ||
urls = ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] | ||
with YoutubeDL() as ydl: | ||
ydl.download(urls) | ||
|
||
|
||
def main(): | ||
if len(sys.argv) > 1: | ||
download_videos(sys.argv[1:]) | ||
print(sys.argv) | ||
from ytdpl_wrapper import download_videos | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
download_videos(sys.argv[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
import sys | ||
from PyQt6.QtWidgets import QApplication, QWidget, QMainWindow | ||
import PyQt6.QtWidgets as qtw | ||
|
||
# from PyQt6.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton, QTextEdit | ||
|
||
from qt.py_ui.main_window import Ui_MainWindow | ||
from ytdpl_wrapper import download_videos | ||
|
||
app = qtw.QApplication(sys.argv) | ||
window = qtw.QMainWindow() | ||
ui = Ui_MainWindow() | ||
ui.setupUi(window) | ||
|
||
|
||
def do__download_all(): | ||
te_youtube_links = window.findChild(qtw.QTextEdit, "te_youtube_links") | ||
youtube_links = te_youtube_links.toPlainText().split() | ||
download_videos(youtube_links) | ||
|
||
|
||
window.findChild(qtw.QPushButton, "pb_download_all").clicked.connect(do__download_all) | ||
|
||
if __name__ == "__main__": | ||
app = QApplication(sys.argv) | ||
window = QMainWindow() | ||
ui = Ui_MainWindow() | ||
ui.setupUi(window) | ||
|
||
window.show() | ||
app.exec() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from yt_dlp import YoutubeDL | ||
|
||
|
||
def download_videos(urls=None): | ||
if not urls or not isinstance(urls, list): | ||
# Rick Astley - Never Gonna Give You Up (Official Music Video) | ||
urls = ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] | ||
with YoutubeDL() as ydl: | ||
ydl.download(urls) |