Giter VIP home page Giter VIP logo

youtube-downloader-desktop's Introduction

Youtube Downloader GUI

Table of Contents

Youtube Downloader GUI Documentation

Quick Start

  1. Configure: In the app's directory, run yarn install and pip install bottle bottle-websocket future whichcraft pyinstaller
  2. Demo: Build static files with yarn build then run the application with python main.py. A Chrome-app window should open running the built code from build/
  3. Distribute: (Run yarn build first) Build a binary distribution with PyInstaller using python -m eel main.py build --onefile (See more detailed PyInstaller instructions at bottom of the main README)
  4. Develop: Open two prompts. In one, run python main.py true and the other, yarn start. A browser window should open in your default web browser at: http://localhost:3000/. As you make changes to the JavaScript in src/ the browser will reload. Any changes to main.py will require a restart to take effect. You may need to refresh the browser window if it gets out of sync with eel.

Installation

python -m venv pip

.\pip\Scripts\activate

pip install -r requirement.txt

yarn install

Main Files

Critical files for this demo

  • src/App.tsx: Modified to demonstrate exposing a function from JavaScript and how to use callbacks from Python to update React GUI

  • main.py: Basic eel file

    • If run without arguments, the eel script will load index.html from the build/ directory (which is ideal for building with PyInstaller/distribution)
    • If any 2nd argument (i.e. true) is provided, the app enables a "development" mode and attempts to connect to the React server on port 3000
  • public/index.html: Added location of eel.js file based on options set in main.py

    <!-- Load eel.js from the port specified in the eel.start options -->
    <script type="text/javascript" src="http://localhost:8080/eel.js"></script>
  • src/react-app-env.d.ts: This file declares window.eel as a valid type for tslint. Note: capitalization of window

  • src/App.css: Added some basic button styling

youtube-downloader-desktop's People

Contributors

amantiwari1 avatar raulpy271 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

youtube-downloader-desktop's Issues

async and await in loops doesn't work in card loading

I have tried promise, await for loop, async, and await doesn't work in input.py

let me explain below

in line 83 in input.py

for await (URL of AllUrl) {
 
dispatch({ type: 'CardLoading', data: true }); //  it should be true so append loading in oneVideo function
 // some code
}

dispatch({ type: 'CardLoading', data: false });  // once it is done then it should be false remove loading but 

the result is remove loading in 1 sec without show loading in the frontend

can't figure out how to fix it? can you fix it? @raulpy271

Valid Youtube Url and Playlist Url

there are 3 main url in youtube

url 1 : https://www.youtube.com/watch?v=........... (11 char) - one video

url 2 : https://www.youtube.com/watch?v=........... &list=.............................(11 char in watch and 34 char in list) - Playlist

url 3 : https://www.youtube.com/playlist?list=................................ (34 char in playlist) -Playlist

If url is same as url 1 then it should true and run function ( one video funtion )

else if url is same as url 2 or url 3 then it should true and run function ( multiple video function )

otherwise it will popup wrong link

I am able to figure out how to do it by using regex here is code below:

https://github.com/amantiwari1/youtube-GUI/blob/8fb1983c7387fe1553a4b5d96eee8eb22b92ec1b/src/components/Input.tsx#L74-L140

But Main issue
if more than 11 char then it return true which is wrong that mean regex is wrong ,
and cant figure out how to use url 2 in regex

can you help me for this? @raulpy271

Doing useless database query

Why every time that the user adds a new video link the backend add the new video in the db and then queries all video and set all video in the interface?

Is most useful to query only the new video and then add it using DetailsReducer with the action add. With this method, we save some queries in the db.

@amantiwari1, what is your opinion?

Error when calling ffmpeg

To call ffmpeg, the code downloadvideo.py use the method call of the lib subprocess. See an example:

subprocess.call(f'ffmpeg.exe -y -i "{vidname}" -i "{audname}" -c:v copy -c:a aac "{outname}"', shell=True)

In my machine, this raises an error because the command should be passed in a list, like this:

subprocess.call(['ffmpeg', '-i', 'input.avi', 'output.mp4'])

@amantiwari1, what do you think?

Error when stating the database

I merged in my local branch the code from the main branch, And when I try to run the app, It raises the following error:

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: video.savefile
[SQL: SELECT video.id AS video_id, video.url AS video_url, video.title AS video_title, video.thumbnail AS video_thumbnail, video."downloadPercent" AS "video_downloadPercent", video.videoquality AS video_videoquality, video.savefile AS video_savefile 
FROM video]
(Background on this error at: http://sqlalche.me/e/14/e3q8)

I didn't try to solve it, @amantiwari1 did you have any idea?

Show error when the link is correct

If the user inserts a valid link to a single video the app shows the card of the video, but also shows the message: 'Please enter a valid YouTube URL'.

Root of the error: Before the commit 356ffbc the state of the cards is changed in the frontend (for the functions oneVideo and onePlaylist). After the above commit, the functions Add_Details and Get_Data_Details_Playlists also change the state. So, the frontend functions expects that the backend returns some data, which not happens, so the frontend concludes that the link is invalid.

Also, this error is from a bed conceptual idea: the backend doesn't should change the state of the interface, this is a role for the frontend. The MVC(and whatever similar pattern), divide the application into layers to turn easy to understand and to turn clear the role of each layer. If the backend could change the state of the interface then it's breaking the principles of a layered system, because the backend should change the database and the frontend should change the state of the front, not the other way around.

So my solution is the following: the function Add_Details and Get_Data_Details_Playlists should return the data of the videos while the function oneVideo and onePlaylist should set the state.

@amantiwari1, what do you think? I'm not a master in MVC, actually, I didn't read much about it, so feels free to fix me in some points.

downloading process is still here in frontend while backend said already download

we need to change bad code to good code in download function

first we need to understand this function

try download 10 mb video, you will find downloading is still here in frontend while backend said already done download

I dont know where is issue in download function? i copied that function from stackoverflow😂

let me know did you find issue once download 10 mb!!
@raulpy271

Error when the url is correct but not exist video with this url

I change the method to check url's in this #8 pull request, even using this method, we can't check if the value of the params v and list represent a video, because the params can have the exact match but the video no necessarily exist. So we need to check it in the backend.

Use the text area to add one url by time

I guess that idea to have a single text area to paste different url's is bad.

Because every time that the user pastes a new url the app will have to handle old and news urls. It will have to decide which url is new or not. These increase the processing and complexity of the application. Besides, the app has to handle any change, for example, if the user adds space or a new line the app will process all links already processed.

To solve it I propose the following: Create an 'Add' button before the download button. So the app will handle a link only when the user clicks on it. Besides, the text area will have only a link by time.

These will work this way: The user inserts a link and clicks on the add button, if the link is correct the app will show the video/playlist card and clear the text area. After it, the user can insert a new link or download these inserted.

With these changes, the app will process less because it won't process links already processed. Besides she won't care about useless changes (as space added), it will only when the user clicks on the 'Add' button.

@amantiwari1, what do you think about it?

Error when inserting a valid url

@amantiwari1,

I changed the regex's of issue #5, but when I insert a valid URL I'm getting the following error:

TypeError: can't convert undefined to object

  111 | 
  112 | console.log(message)
  113 | if (message !== true) {
> 114 |     SetAllDetail({ message, type: 'add' });
      | ^
  115 | }
  116 | setCardLoading(false)
  117 | 

I printed the value of message and it is null. Even before the changes that I did today the error already exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.