-
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.
- Loading branch information
0 parents
commit cb4157d
Showing
8 changed files
with
917 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,20 @@ | ||
#------------------------------------------------- | ||
# | ||
# Project created by QtCreator 2016-12-02T21:24:20 | ||
# | ||
#------------------------------------------------- | ||
|
||
QT += core gui | ||
|
||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | ||
|
||
TARGET = Qutube-dl | ||
TEMPLATE = app | ||
|
||
|
||
SOURCES += main.cpp\ | ||
qutubedl.cpp | ||
|
||
HEADERS += qutubedl.h | ||
|
||
FORMS += qutubedl.ui |
Large diffs are not rendered by default.
Oops, something went wrong.
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,41 @@ | ||
This is a free youtube video downloader. It is a Qt based GUI frontend for youtube-dl. (See https://github.com/rg3/youtube-dl) | ||
|
||
HOW TO COMPILE. | ||
|
||
unpack the file in your preferred location | ||
|
||
type the following: | ||
|
||
cd Qutube-dl | ||
qmake Qutube-dl.pro | ||
make | ||
|
||
you may also use QtCreator to compile. | ||
|
||
SETUP | ||
|
||
Create a folder 'Qutube-dl' | ||
Move the executable (.exe for windows users) file just compiled into the folder. | ||
|
||
Windows users add the bin directory of your Qt installation (e.g. <QT_DIR\bin>) to the PATH variable and then run: | ||
|
||
windeployqt <path to Qutube-dl executable> | ||
|
||
Create a new folder 'youtube-dl' within 'Qutube-dl' folder | ||
download the latest version of youtube-dl from https://rg3.github.io/youtube-dl/ and place within 'youtube-dl' folder. | ||
|
||
Windows users must download the 'Windows executable that includes Python.' | ||
Linux users must download python version by typing | ||
|
||
wget https://yt-dl.org/downloads/latest/youtube-dl | ||
|
||
HOW TO USE | ||
|
||
copy and paste the video url in the box labelled 'Url' | ||
|
||
You may directly press button 'Go!' to download the video to your desired location. | ||
You may check the available versions by clicking 'Available Versions?' button. | ||
Look for numbers under 'format code' in the output if you click the 'Available Versions?' button. Enter the desired format code in 'Format code' box and press 'Go!' | ||
|
||
Thanks for using Qutube-dl! | ||
|
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,11 @@ | ||
#include "qutubedl.h" | ||
#include <QApplication> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QApplication a(argc, argv); | ||
Qutubedl w; | ||
w.show(); | ||
|
||
return a.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
#include "qutubedl.h" | ||
#include "ui_qutubedl.h" | ||
#include <QString> | ||
#include <QDebug> | ||
#include <QProcess> | ||
#include <QDir> | ||
#include <QFileDialog> | ||
Qutubedl::Qutubedl(QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::Qutubedl) | ||
{ | ||
ui->setupUi(this); | ||
} | ||
|
||
Qutubedl::~Qutubedl() | ||
{ | ||
delete ui; | ||
delete youtube; | ||
} | ||
|
||
|
||
void Qutubedl::on_Go_pb_clicked() | ||
{ | ||
get_texts(); | ||
QStringList argument; | ||
|
||
if (proxy!="") | ||
argument<<"--proxy"<<proxy; | ||
if (fmt!="") | ||
argument<<"-tf"<<fmt; | ||
argument<<Url; | ||
qDebug()<<argument; | ||
|
||
button_handle(); | ||
|
||
QDir open; | ||
youtube_d_handle(); | ||
|
||
QFileDialog *d_path = new QFileDialog; | ||
QString d_path_string=d_path->getExistingDirectory(this,"Save Directory", QDir::homePath()); | ||
qDebug()<<d_path_string; | ||
open.setCurrent(d_path_string); | ||
qDebug()<<argument; | ||
if(d_path_string !="") | ||
click_handle(argument); | ||
} | ||
|
||
//Fetches Available formats | ||
void Qutubedl::on_get_fmt_pb_clicked() | ||
{ | ||
f_cb.clear(); | ||
get_texts(); | ||
youtube_d_handle(); | ||
button_handle(); | ||
QStringList argument; | ||
argument<<"-F"<<Url; | ||
click_handle(argument); | ||
} | ||
|
||
//update youtube-dl | ||
void Qutubedl::on_updt_bcknd_pb_clicked() | ||
{ | ||
youtube_d_handle(); | ||
button_handle(); | ||
QStringList argument; | ||
argument<<"-U"; | ||
click_handle(argument); | ||
} | ||
|
||
//fetches texts entered | ||
void Qutubedl::get_texts() | ||
{ | ||
Url=ui->url->text(); | ||
proxy=ui->prxy->text(); | ||
fmt=ui->frmt->text(); | ||
} | ||
|
||
//calls youtube-dl with given arguments | ||
void Qutubedl::click_handle(QStringList argument) | ||
{ | ||
#ifdef Q_OS_LINUX | ||
youtube->start(youtube_path+"./youtube-dl", argument); | ||
#else | ||
youtube->start(youtube_path+"youtube-dl.exe", argument); | ||
#endif | ||
|
||
} | ||
|
||
//Sets youtube-dl directory path in variable youtube_path | ||
void Qutubedl::youtube_d_handle() | ||
{ | ||
QDir open; | ||
if(!open.cd("youtube-dl")) | ||
qWarning("Cannot Find Directory \"youtube-dl\""); | ||
if(i==0) | ||
{ | ||
youtube_path=open.currentPath()+open.fromNativeSeparators("//youtube-dl")+open.fromNativeSeparators("/"); | ||
i++; | ||
} | ||
qDebug()<<youtube_path+"./youtube-dl"; | ||
} | ||
|
||
//connections to QProcess instance youtube | ||
void Qutubedl::button_handle() | ||
{ | ||
connect(youtube,SIGNAL(started()),this, SLOT(disable_go())); | ||
connect(youtube,SIGNAL(finished(int)),this, SLOT(enable_go())); | ||
connect(youtube,SIGNAL(readyReadStandardOutput()),this, SLOT(readoutput())); | ||
connect(youtube,SIGNAL(readyReadStandardError()),this, SLOT(readoutput())); | ||
} | ||
|
||
//Disables Go Pushbutton | ||
void Qutubedl::disable_go() | ||
{ | ||
ui->Go_pb->setEnabled(false); | ||
} | ||
|
||
//Enables Go Pushbutton | ||
void Qutubedl::enable_go() | ||
{ | ||
ui->Go_pb->setEnabled(true); | ||
f_output.clear(); | ||
} | ||
|
||
//Output of youtube-dl is printed in QTextBrowser output_tb | ||
void Qutubedl::readoutput() | ||
{ | ||
QByteArray output=youtube->readAllStandardOutput(); | ||
QByteArray output2=youtube->readAllStandardError(); | ||
if (QString(output).contains("[download]", Qt::CaseSensitive)) | ||
f_output=QString(output); | ||
else | ||
f_output=f_output+QString(output); | ||
f_output=f_output+QString(output2); | ||
qDebug()<<f_output; | ||
ui->output_tb->setText(f_output); | ||
} | ||
|
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,47 @@ | ||
#ifndef QUTUBEDL_H | ||
#define QUTUBEDL_H | ||
|
||
#include <QWidget> | ||
#include <QProcess> | ||
#include <QString> | ||
|
||
namespace Ui { | ||
class Qutubedl; | ||
} | ||
|
||
class Qutubedl : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit Qutubedl(QWidget *parent = 0); | ||
~Qutubedl(); | ||
|
||
private slots: | ||
void on_Go_pb_clicked(); | ||
void disable_go(); | ||
void enable_go(); | ||
void readoutput(); | ||
|
||
void on_get_fmt_pb_clicked(); | ||
|
||
void on_updt_bcknd_pb_clicked(); | ||
|
||
private: | ||
Ui::Qutubedl *ui; | ||
QProcess *youtube=new QProcess; | ||
QString f_output; | ||
QString f_cb; | ||
int i=0,z=0; | ||
QString youtube_path; | ||
QString Url; | ||
QString proxy; | ||
QString fmt; | ||
|
||
void get_texts(); | ||
void click_handle(QStringList argument); | ||
void button_handle(); | ||
void youtube_d_handle(); | ||
}; | ||
|
||
#endif // QUTUBEDL_H |
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,113 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Qutubedl</class> | ||
<widget class="QWidget" name="Qutubedl"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>699</width> | ||
<height>345</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Qutubedl</string> | ||
</property> | ||
<layout class="QGridLayout" name="gridLayout"> | ||
<item row="6" column="0" colspan="2"> | ||
<widget class="QTextBrowser" name="output_tb"> | ||
<property name="html"> | ||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> | ||
<html><head><meta name="qrichtext" content="1" /><style type="text/css"> | ||
p, li { white-space: pre-wrap; } | ||
</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> | ||
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">This program is a Qt based GUI frontend for youtube-dl program.</span></p> | ||
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">Copyright (C) 2016 Samadrita Karmakar (samadritakarmakar@gmail.com)</span></p> | ||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Hack';"><br /></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">This program is free software: you can redistribute it and/or modify</span></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">it under the terms of the GNU General Public License as published by</span></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">the Free Software Foundation, either version 3 of the License, or</span></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">(at your option) any later version.</span></p> | ||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Hack';"><br /></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">This program is distributed in the hope that it will be useful,</span></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">but WITHOUT ANY WARRANTY; without even the implied warranty of</span></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">GNU General Public License for more details.</span></p> | ||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Hack';"><br /></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">You should have received a copy of the GNU General Public License</span></p> | ||
<p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></p></body></html></string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="0" column="0"> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>Url:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="0"> | ||
<widget class="QLabel" name="label_3"> | ||
<property name="text"> | ||
<string>Format Code:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="3" column="0"> | ||
<widget class="QLabel" name="label_2"> | ||
<property name="text"> | ||
<string>Proxy:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="1"> | ||
<widget class="QLineEdit" name="frmt"> | ||
<property name="text"> | ||
<string>18</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="0" column="1"> | ||
<widget class="QLineEdit" name="url"> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="3" column="1"> | ||
<widget class="QLineEdit" name="prxy"/> | ||
</item> | ||
<item row="5" column="1"> | ||
<widget class="QPushButton" name="Go_pb"> | ||
<property name="text"> | ||
<string>Go!</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="5" column="0"> | ||
<widget class="QPushButton" name="get_fmt_pb"> | ||
<property name="text"> | ||
<string>Available Format?</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="4" column="0"> | ||
<widget class="QPushButton" name="updt_bcknd_pb"> | ||
<property name="text"> | ||
<string>Update Backend</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="4" column="1" alignment="Qt::AlignHCenter"> | ||
<widget class="QLabel" name="label_4"> | ||
<property name="text"> | ||
<string>eg: socks://127.0.0.1:9050/</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<layoutdefault spacing="6" margin="11"/> | ||
<resources/> | ||
<connections/> | ||
</ui> |