Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
/ AparatVideoUploader Public archive

Simple Crawler that uploads video into Aparat.com Video Sharing Service

License

Notifications You must be signed in to change notification settings

m2sh/AparatVideoUploader

Repository files navigation

AparatVideoUploader

Build Status

Simple Video Uploader for Aparat.com based on Goutte .

###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 ###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 :

include 'vendor/autoload.php'

Create instalnce from uploader class :

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

Specify username & password of your aparat.com account :

$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 :

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

PrepareUpload

Prepares uploader to uploading video :
$uploader->prepareUpload();
Also you can use Chain method like this :
$uploader->login()->prepareUpload();
####GetVideoCategories Get Video Categories for UploadVideo

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

####UploadFromFile Upload Video From file to your account :

$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();'

RemoveVideo

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

###Issues If you have find any bug in this package please create new issue.

About

Simple Crawler that uploads video into Aparat.com Video Sharing Service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages