Introducing OneLoveDTube IPFS Video Uploader: An alternative way of posting videos onto DTubesteemCreated with Sketch.

in #onelovedtube6 years ago

Repository

https://github.com/techcoderx/ipfsVideoUploader

Overview

About

OneLoveDTube IPFS video uploader is an alternative uploader that uploads videos onto DTube. The main aim of this project is to create a product that anyone can setup themselves easily, something that is easy to use and most importantly, to create a solution so that content creators have choices of which uploader they want to use to upload their videos, instead of relying on a single upload server.

Although the official DTube devs did release the uploader package, it is difficult to set up, and it only serves as an API (does not come with a UI). As my uploader comes with a UI that is usable, all it will take for them is a few steps to download and run the app, as mentioned in the documentation.

Whether if there's long encoding queues, or DTube's upload server downtime, there's no reason not to upload to DTube, because with the easy to setup and use uploader, anyone can host their own DTube upload servers for the benefit of the entire DTube community. In addition to that, creators who upload using my uploader have a chance of getting curated by DTube curation team, just like any other DTube video. Here's the proof (you can see that the app name in json_metadata is different, and the beneficiaries are different too).

Disclaimer: IPFS Video Uploader does not serve as a replacement of DTube's official uploader.

How it works

My uploader is written using the ExpressJS framework, which is an extension of the popular NodeJS runtime that is designed for web applications. Two pages are included as for the UI - a welcome page and an upload page.

The welcome page included is designed for the @onelovedtube community, that contains has a sign up button (more on that below), and a sign in button that leads users to SteemConnect login. After logging in it redirects the user to the uploader page.

Once the SteemConnect access token is obtained by the user, it uses that to get the associated Steem username on the client side. Then, it's sent to the server to check if it is in the whitelist if the whitelisting system is enabled in config.json to restrict the users that are uploading to their upload servers. If they're not in the list, it disables all the fields in the uploader page and alerts the user about it.

As for handling upload requests, the metadata entered is validated first before making an upload AJAX call. I have decided to use axios framework to handle AJAX calls, and Multer framework for parsing uploads as Multer is well optimised for the Express framework (and written by Express too). After Multer parses the file, it then adds both the source video and thumbnail to the IPFS node (setup within the same server as this uploader), then generates a sprite (which is basically a preview of the video when you scrub through the player), and adds that to IPFS as well. These are handled by ShellJS framework, which is the same framework that I have used in my IPFS Discord Bot to handle pinning requests. Express then returns the resulting IPFS hash for all 3 files (source video, thumbnail and sprite), plus the video file size (in bytes) and video duration (in seconds) to the client.

IPFS pinning will be handled asynchronously, so there will be no queues to wait! Also there will be no video encoding support (NodeJS is not a good choice for compute intensive applications anyway). Encoding needs to be done on the user end (more on that in the roadmap below), as I think that should provide more decentralization for encoding source videos, as well as lowering the overhead cost of running the uploader (together with IPFS node).

Once the client receives the hashes, it then proceed to publish the post onto the Steem blockchain. This is done on client side using SteemConnect API. The transaction is created the same way as DTube's uploader so that it will be identified as a DTube video and may get picked up by their curators. Once it has been successfully published onto the blockchain, it redirects to the watch page of the newly uploaded video, on d.tube.

OneLoveDTube will be running the uploader!

As a community, we are working together to support video content creators on DTube, as well as providing the right tools they need to be successful on DTube. Due to this, we have identified several issues on DTube (upload & playback issues that many have been reporting these days) and decided to create tools like this one.

Since @onelovedtube is responsible for hosting the videos and maintaining the servers (while supporting DTube core devs), the fee structure of using OneLoveDTube's uploader service will have to be changed. After a chat with @heimindanger (and a separate discussion with other OneLoveDTube admins), we have decided to set the beneficiaries to @dtube at 8%, plus a flat fee of $10 USD a month per person to pay for the servers (we're using the included whitelist system to check for paying users). By signing up our $10 USD/month package, the creator will also gain access to HD pinning commands of my IPFS Discord Bot in @onelovedtube discord server. Existing subscribers will gain access to the uploader for free, starting today.

The website is LIVE at https://uploader.oneloved.tube.

Screen Shot 20181026 at 10.40.09 PM.png

Roadmap

  1. Options to upload user encoded versions of source video (240p, 480p, 720p & 1080p).
  2. Save entered metadata as draft in the browser (I'm surprised that DTube did not implement this in their uploader interface!)
  3. Library that contains resources for uploader (tutorials, FAQs etc.)
  4. Migration from SteemConnect login to another more secure auth solution.
  5. A setup script to install and setup all required dependencies in one terminal command (making it even more user friendly to setup 😉)
  6. A mobile app that uploads DTube videos, just like this uploader (not sure if I can make it 🤔)

How to contribute

If you found any ways to improve on the code or found any bugs, feel free to create a pull request on the GitHub repository. You can also contact me on Discord techcoderx#7481 or join @onelovedtube Discord server if you have any enquiries.

Github account

https://github.com/techcoderx

Sort:  

Thank you for your contribution.

  1. It looks to me that uploader.js at client side so it is possible that users could modify the beneficiaries value?
  2. generatePermlink is not random enough, there may be collision. It is better to provide something more universal unique randomness e.g. GUID
  3. Shell.exec may expose security issues if you don't check and wrap your parameters e.g. filename
  4. It is not necessary to upload node_modules to git.

Overall, nice piece of work!

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you for your valuable feedback!

  1. This can be a small fix by getting value from server, then returning that value together with the resulting IPFS hashes. I didn't know that it can be changed through inspect element!

  2. My generatePermlink() works the same way as how DTube generates permlinks here, so perhaps they need to think about this too.

  3. Probably I need to sanitize ShellJS exec parameters 🤔

Thank you for your review, @justyy! Keep up the good work!

Great work Techcoderx. This tool will help many people.

Absolutely love it!

I contributed too 😉 the domain to use once I figured out the DNS 😂

It’s a dang good thing we have you in the community @techcoderx your coding our dreams into reality, next step we master the mobile front! 💪

Posted using Partiko iOS

Woot woot! You are awesome! You can let spectrumecons know about this. @techcoderx :)

This tool, the IPFS bot and your posts about them are genius and a real help for a lot of people!
Thank you for the good work and I hope for big success of the uploader!
Thanks for your big effort to make this possible and for sharing all the sources with us! This is just incredible.

Booyah !
#engagetogrow

Wow, this is quite incredible. Gonna have to check this thing out 💪🏻 Appreciate the option of using an alternate uploader as us content creators need plenty of avenues to keep our flow, flowing.

-Ken

This is the answer of upload issues on DTube while everyone else is trying to be a solution 😉

Great stuff dude 😀😀

Posted using Partiko iOS

this is amazing, great piece of work....appreciate all you do for the platform and this uploader is going to be a great tool for the many people that are having difficulties trying to upload video on dtube, Its quite a learning curve for some and you just simplified the whole process, looking forward to using it hopefully tomorrow.

I upvoted your post.

Keep steeming for a better tomorrow.
@Acknowledgement - God Bless

Posted using https://Steeming.com condenser site.

Hi @techcoderx!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63914.63
ETH 2664.93
USDT 1.00
SBD 2.77