2017 © Pedro Peláez
 

library aparatvideouploader

a simple class that uploads video into aparat.com video sharing website

image

m2sh/aparatvideouploader

a simple class that uploads video into aparat.com video sharing website

  • Saturday, March 5, 2016
  • by m2sh
  • Repository
  • 2 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

AparatVideoUploader

Build Status, (*1)

Simple Video Uploader for Aparat.com based on Goutte ., (*2)

Installation

Using Composer :
composer require m2sh/aparatvideouploader
Or
Clone this repo with
git clone https://github.com/m2sh/AparatVideoUploader
Then install Dependencies with composer install, (*3)

Requirments

  • Because of using GuzzleHttp client in Goutte this package only work on PHP version 5.5 & above.
  • An Account from Aparat.com.

Usage

First include composer auto loader :, (*4)

include 'vendor/autoload.php'

Create instalnce from uploader class :, (*5)

$uploader = new \m2sh\AparatVideoUploader\AparatVideoUploader();

Specify username & password of your aparat.com account :, (*6)

$uploader->setAuthenticationInfo('YOUR USERNAME', 'YOUR PASSWORD');

Methods

Login

Login User to aparat.com :
$uploader->login();
To find out that the login is successful, check isUserLoggedIn property :, (*7)

if($uploader->isUserLoggedIn) {
    // do something
}

PrepareUpload

Prepares uploader to uploading video :
$uploader->prepareUpload();
Also you can use Chain method like this :
$uploader->login()->prepareUpload();, (*8)

GetVideoCategories

Get Video Categories for UploadVideo, (*9)

$categories = $uploader->getVideoCategories();
echo $categories[0];

UploadFromFile

Upload Video From file to your account :, (*10)

$file =  __DIR__ . "/video/ghost.mp4";

$videoDetail = [
    'title' => 'پسری که روح می‌شود',
    'description' => 'شوخی با پدر',
        'category' => 2,
        'tags' => ['روح','شوخی'],
    'comment_permission' => 'no'
];

$uploader->uploadFromFile($file,$videoDetail);

GetVideoList

Get uploaded video list
$videoList = $uploader->getVideoList();', (*11)

RemoveVideo

Removes Video with given remove_link url from GetVideoList method :
$uploader->removeVideo($videoList[0]['remove_link']);, (*12)

Issues

If you have find any bug in this package please create new issue., (*13)

The Versions

05/03 2016

dev-master

9999999-dev

a simple class that uploads video into aparat.com video sharing website

  Sources   Download

MIT

The Requires

 

by Avatar m2sh

uploader goutte aparat