Skip to content

Upload videos from third party applications

Daniel Neto edited this page Jan 6, 2020 · 15 revisions

This tutorial will clarify how third parties apps can Upload files to YouPHPTube

How to get the Password Hash

Every YouPHPTube installation has a script to encode your password. it may be different on each installation if you are using salt to increase security.

For example on our demo site, we can get the hash for the password 123 in the following way.

https://demo.avideo.com/objects/encryptPass.json.php?pass=123

Where to Upload

We will use the Mobile Plugin Upload File to receive the file, you will need to upload your video to the URL

yourSite+'plugin/MobileManager/upload.php?user='+ this.user.login + '&pass=' + this.user.encryptedPassword

For example, to upload to the demo site on the Admin profile, your URL will be

https://demo.avideo.com/plugin/MobileManager/upload.php?user=admin&pass=encryptPassword(123)

and the file post key should be 'upl', we expect in PHP to receive $_FILES['upl']

so, if you are using HTML you should have a form like this ...

<form enctype="multipart/form-data" method="post" action="http://127.0.0.1/avideo/plugin/MobileManager/upload.php?user=admin&pass=<?php echo encryptPassword('123'); ?>">
    <input name="title" type="text" /><br>
    <textarea name="description"></textarea><br>
    <input name="categories_id" type="hidden" value="1" />
    <input name="upl" type="file"  accept="video/mp4"  /><br>
    <input type="submit" value="submit" id="submit"/>
</form>

You can find the encryptPassword function here https://github.com/WWBN/AVideo/blob/ec87a31ff71c22d22079d15ab0f64a95bb6860de/objects/functions.php#L1147

You also can send GET or POST variables to it with the following values: title, description, and categories_id

Clone this wiki locally