/**
  * Method to get comments from Instagram media
  *
  * @see constructQuery
  *
  * @param $shortcode
  * @param null $cursor_before
  * @param null $limit
  * @return array
  */
 public function get($shortcode, $cursor_before = NULL, $limit = NULL)
 {
     if (!$cursor_before) {
         $resultObj = new MediaInfo($this->client);
         $result = $resultObj->get($shortcode);
         $this->shortcode = $shortcode;
     } else {
         $post_params = $this->constructQuery($shortcode, $cursor_before, $limit);
         $result = $this->asObject($this->client->webRequest('/query/', 'POST', [], $post_params));
     }
     $media = ['cursor_before' => !empty($result->comments->page_info->start_cursor) ? $result->comments->page_info->start_cursor : NULL, 'data' => !empty($result->comments->nodes) ? $result->comments->nodes : array()];
     return $media;
 }
 public function loadInfo()
 {
     if (Settings::getMediaInfoxecutable() !== false) {
         $lMovieMediaInfo = new MediaInfo($this->lID);
         $this->lDuration = $lMovieMediaInfo->getDuration();
         // In seconds
         $this->lBitrate = $lMovieMediaInfo->getBitrate();
         $this->lWidth = $lMovieMediaInfo->getWidth();
         $this->lHeight = $lMovieMediaInfo->getHeight();
         unset($lMovieMediaInfo);
     }
 }
Beispiel #3
0
 function handle()
 {
     $media = MediaInfo::getInfo($this->mid);
     if (!$media || !$media->isVisible) {
         throw new VoiceException("No media");
     }
     $playlist = $this->playlistDb->getInfo($this->lid);
     if (!$playlist) {
         throw new VoiceException("No playlist");
     }
     if ($playlist->userid != $this->userid) {
         throw new VoiceException("Mismatch userid");
     }
     $playlist->addMediaId($this->mid);
     $this->playlistDb->updateInfo($playlist);
     $this->assign('status', 'ok');
     $this->assign('title', $playlist->title);
 }
Beispiel #4
0
 function initialize()
 {
     $this->checkSession();
     $this->assignSession();
     if ($_REQUEST['memory']) {
         $string = $_REQUEST['memory'];
         $string = str_replace('\\"', '"', $string);
         /////bug of browzer ?
         $this->memory = json_decode($string, true);
     }
     if ($_REQUEST['program']) {
         $this->memory = array('program' => $_REQUEST['program']);
     }
     if ($_REQUEST['playlist_id']) {
         $this->memory = array('program' => PlaylistProgram::NAME, 'pid' => $_REQUEST['playlist_id']);
         return;
     }
     if ($_REQUEST['mid']) {
         $mid = $_REQUEST['mid'];
         $this->media = MediaInfo::getInfo($mid, array('detail' => true));
         return;
     }
 }
Beispiel #5
0
 function initialize()
 {
     $path = $_SERVER['PHP_SELF'];
     $cells = mb_split('/', $path);
     $filename = array_pop($cells);
     $key = array_pop($cells);
     $userid = array_pop($cells);
     $file = mb_split('\\.', $filename);
     $mid = $file[0];
     $ext = $file[1];
     if ($ext != "mp3") {
         throw new VoiceException(self::ERROR_INVALID_FORMAT);
     }
     $_REQUEST[LoginSession::SESSION_USERID] = $userid;
     $_REQUEST[LoginSession::SESSION_KEY] = $key;
     if (!LoginSession::get()->check()) {
         throw new VoiceException(self::ERROR_NO_SESSION);
     }
     $this->info = MediaInfo::getInfo($mid);
     if (!$this->info) {
         throw new VoiceException(self::ERROR_NO_INFO);
     }
 }
Beispiel #6
0
 function addMedia(&$medias, $vid)
 {
     if (!$vid) {
         throw new VoiceMessageException('NO_MEDIA_INFO');
     }
     $info = MediaInfo::getInfo($vid);
     if (!$info) {
         return;
     }
     $medias[] = $info;
 }
Beispiel #7
0
 function nextInfo()
 {
     $playlistInfo = $this->getPlaylistInfo();
     $mid = $playlistInfo->getMediaId($this->index + 1);
     return MediaInfo::getInfo($mid);
 }
Beispiel #8
0
					<!--/#login.form-action-->
					<div id="download" class="form-action show">
						  <h1>Download</h1>
						<p>
								Size: {{$file_size}} <br>
						</p>
							<ul>
								<li style="padding-top: 20px;">
										<a href="{{$link}}"><button class="button">Download</button></a>
								</li>
							</ul>
					</div>
					<div id="info" class="form-action hide">
					@if(!$media->downloading())
					<?php 
$media_info = MediaInfo::where('media_id', '=', $media->id)->where('file_id', '=', $file->id)->first();
?>
					@endif
						<h1>File Info</h1>
						<p>
							Name: {{$file->name}} <br>
							Size: {{$file_size}} <br>
							@if(isset($media_info->video_codec_name) && $media_info->video_codec_name != null)
							Type: {{$media_info->video_codec_name}} <br>
							@endif
							@if(isset($media_info->video_duration) && $media_info->video_duration != null)
							Duration: {{$media_info->video_duration}} <br>
							@endif
							@if(isset($media_info->video_width) && $media_info->video_width != null)
							Width: {{$media_info->video_width}} Height: {{$media_info->video_height}} <br>
							@endif
Beispiel #9
0
<?php

$m = new MediaInfo();
$info = $m->getMovieInfo('American Beauty');
print_r($info);
class MediaInfo
{
    public $info;
    function __construct($str = null)
    {
        if (!is_null($str)) {
            $this->autodetect($str);
        }
    }
    function autodetect($str)
    {
        // Attempt to cleanup $str in case it's a filename ;-)
        $str = pathinfo($str, PATHINFO_FILENAME);
        $str = $this->normalize($str);
        // Is it a movie or tv show?
        if (preg_match('/s[0-9][0-9]?.?e[0-9][0-9]?/i', $str) == 1) {
            $this->info = $this->getEpisodeInfo($str);
        } else {
            $this->info = $this->getMovieInfo($str);
        }
        return $this->info;
    }
    function getEpisodeInfo($str)
    {
        $arr = array();
        $arr['kind'] = 'tv';