Giter Site home page Giter Site logo

Comments (11)

mayeaux avatar mayeaux commented on July 23, 2024 2

Hey perfect, glad to hear it man! Keep it up, knowing JavaScript will be really important in the coming years.

from videodownloader.

david-littlefield avatar david-littlefield commented on July 23, 2024 1

Cool, thanks @mayeaux !

from videodownloader.

david-littlefield avatar david-littlefield commented on July 23, 2024 1

Sounds good, thanks @mayeaux ! =]

from videodownloader.

david-littlefield avatar david-littlefield commented on July 23, 2024 1

Awesome, thanks @mayeaux ! =]

from videodownloader.

david-littlefield avatar david-littlefield commented on July 23, 2024 1

@mayeaux , I figured it out!

Today, I went through your code again. I followed it from start to finish. I looked up and commented the purpose of each function. And, I finally realized that "youtube-dl" was an embedded executable file. And, that it was the key to downloading videos! =]

Then, I researched how to run an executable file in Swift, which turned out to be pretty simple.

And now, I just downloaded my first video in my MacOS application! Which, only really means that I setup "youtube-dl" and passed it a url in an arguments array. But, the important part is that it works!

Thank you @mayeaux , for your encouragement and clarification. Working through this project has definitely helped me understand JavaScript on a whole new level! =]

from videodownloader.

mayeaux avatar mayeaux commented on July 23, 2024

Hey thanks, but there's already a native version of it available here:
https://github.com/mayeaux/videodownloader/releases/download/1.0.0/videodownloader-1.0.0.dmg

That doesn't have the latest code, but basically Electron can be packaged as a native app for the different operating systems, that's one of the reasons I chose it. Let me know if that clears things up for you and thanks for the support!

from videodownloader.

david-littlefield avatar david-littlefield commented on July 23, 2024

Hi @mayeaux , thanks for getting back about this! To clarify, I'm trying to add your download feature into my own native MacOS app, which I'll use to download a list of video urls automatically.

For example, this is an app that another awesome developer and I have been building from his repo, which downloads a complete website into a single html file. It's been a lot of fun, and we're almost done - just fixing a few bugs. Then, we're going to open source it, and post it in his community.

My Swift is ok, but I struggle with JavaScript. Would it be ok to reach out to you for help troubleshooting? =]

from videodownloader.

mayeaux avatar mayeaux commented on July 23, 2024

My recommendation would be to use this as a project to improve your JavaScript. :) I'm already too stretched with projects but I wish you the best of luck! If you get super stuck with something feel free to reach out but I will leave this project to you, good luck!

from videodownloader.

mayeaux avatar mayeaux commented on July 23, 2024

We can leave this issue open maybe someone else will read this thread and want to join you.

from videodownloader.

david-littlefield avatar david-littlefield commented on July 23, 2024

Hi @mayeaux !

I went through your code line-by-line today, read up on the api, and tested some javascript in the browser, and in XCode. And, I think I kind of get what's happening. But, just to make sure, could you please help clarify a few things?

It seemed like a lot of the code was for the user interface, collecting user data, and formatting it to download videos. And, in terms of actually downloading videos, the heavy lifting was performed by the dependencies, right?

Dependencies:
ffmpeg for converting the video from a data file to a video.
fs for checking if a file exists and downloading files locally.
youtube-dl for downloading videos from 110 sites.
ytdl-core for downloading YouTube videos.

But, I don't understand how you're running an npm package in a native MacOS application. Does electron manage the modules for you? And if so, did you have to rebuild the npm packages for electron?

from videodownloader.

mayeaux avatar mayeaux commented on July 23, 2024

Yeah sorry it's a bit jumbled, it was made very quickly. You're basically correct in all your assumptions.

ffmpeg though is for post-processing with youtube-dl
fs is a native Node module
ytdl-core I think I use for getting titles.

And Electron basically packages the modules in a way such that they can be accessed from the browser. I'm not totally sure how it works under the hood but it allows files from node_modules to be called from what feels like the client side.

Hope that helps! And yeah the code is pretty simple so might as well dive in yourself I figure, a good way to learn Javascript for sure.

from videodownloader.

Related Issues (20)

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.