3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Conversion Class include 'config.class.php'; class YouTubeToMp3Converter extends Config { // Private Fields private $_songFileName = ''; private $_flvUrls = array(); private $_tempVidFileName; private $_uniqueID = ''; private $_vidSrcTypes = array('source_code', 'url'); private $_percentVidDownloaded = 0; #region Public Methods function __construct() { $this->_uniqueID = time() . "_" . uniqid('', true); } function DownloadVideo($youTubeUrl) { $file_contents = file_get_contents($youTubeUrl); if ($file_contents !== false) { $this->SetSongFileName($file_contents); $this->SetFlvUrls($file_contents); if ($this->GetSongFileName() != '' && count($this->GetFlvUrls()) > 0) { return $this->SaveVideo($this->GetFlvUrls()); } } return false; } function GenerateMP3($audioQuality) { $qualities = $this->GetAudioQualities(); $quality = (in_array($audioQuality, $qualities)) ? $audioQuality : $qualities[1]; $exec_string = parent::_FFMPEG.' -i '.$this->GetTempVidFileName().' -vol '.parent::_VOLUME.' -y -acodec libmp3lame -ab '.$quality.'k '.$this->GetSongFileName() . ' 2> logs/' . $this->_uniqueID . '.txt'; $ffmpegExecUrl = preg_replace('/(([^\/]+?)(\.php))$/', "exec_ffmpeg.php", "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); $postData = "cmd=".urlencode($exec_string); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $ffmpegExecUrl); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_TIMEOUT, 1); curl_exec($ch); curl_close($ch); } function DownloadMP3($file) { $filepath = parent::_SONGFILEDIR . urldecode($file); $filename = urldecode($file); if (parent::_ENABLE_CONCURRENCY_CONTROL) { $filename = preg_replace('/((_uuid-)(\w{13})(\.mp3))$/', "$4", $filename); } if (is_file($filepath)) { header('Content-Type: audio/mpeg3'); header('Content-Length: ' . filesize($filepath)); header('Content-Disposition: attachment; filename="'.$filename.'"'); ob_clean(); flush(); readfile($filepath); die(); } else { $redirect = explode("?", $_SERVER['REQUEST_URI']); header('Location: ' . $redirect[0]); } } function ExtractSongTrackName($vidSrc, $srcType) { $name = ''; $vidSrcTypes = $this->GetVidSrcTypes(); if (in_array($srcType, $vidSrcTypes)) { $vidSrc = ($srcType == $vidSrcTypes[1]) ? file_get_contents($vidSrc) : $vidSrc; if ($vidSrc !== false) { if (preg_match('/(<title>)(.+?)( - YouTube)(<\/title>)/', $vidSrc, $matches) == 1) { $name = trim($matches[2]); $name = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $name); $name = (!empty($name)) ? html_entity_decode($name) : 'unknown_'.time(); } } } return $name; } function ExtractVideoId($youTubeUrl) { $v = ''; $urlQueryStr = parse_url(trim($youTubeUrl), PHP_URL_QUERY); if ($urlQueryStr !== false && !empty($urlQueryStr)) { parse_str($urlQueryStr); } return $v; } function UpdateVideoDownloadProgress($downloadSize, $downloaded, $uploadSize, $uploaded) { $percent = round($downloaded/$downloadSize, 2) * 100; if ($percent > $this->_percentVidDownloaded) { $this->_percentVidDownloaded++; echo '<script type="text/javascript">updateVideoDownloadProgress("'. $percent .'");</script>'; ob_end_flush(); ob_flush(); flush(); } } #endregion #region Private "Helper" Methods private function SaveVideo(array $urls) { $success = false; $vidCount = -1; while (!$success && ++$vidCount < count($urls)) { $this->_percentVidDownloaded = 0; $this->SetTempVidFileName(); $file = fopen($this->GetTempVidFileName(), 'w'); $ch = curl_init(); curl_setopt($ch, CURLOPT_FILE, $file); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_URL, $urls[$vidCount]); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_NOPROGRESS, false); //curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, array($this, 'UpdateVideoDownloadProgress')); curl_setopt($ch, CURLOPT_BUFFERSIZE, 4096000); curl_exec($ch); curl_close($ch); fclose($file); if (is_file($this->GetTempVidFileName())) { if (!filesize($this->GetTempVidFileName()) || filesize($this->GetTempVidFileName()) < 10000) { unlink($this->GetTempVidFileName()); } else { $success = true; } } } return $success; } #endregion #region Properties public function GetSongFileName() { return $this->_songFileName; } private function SetSongFileName($file_contents) { $vidSrcTypes = $this->GetVidSrcTypes(); $trackName = $this->ExtractSongTrackName($file_contents, $vidSrcTypes[0]); if (!empty($trackName)) { $fname = parent::_SONGFILEDIR . preg_replace('/_{2,}/','_',preg_replace('/ /','_',preg_replace('/[^A-Za-z0-9 _-]/','',$trackName))); $fname .= (parent::_ENABLE_CONCURRENCY_CONTROL) ? uniqid('_uuid-') : ''; $this->_songFileName = $fname . '.mp3'; } } public function GetFlvUrls() { return $this->_flvUrls; } private function SetFlvUrls($file_contents) { $vidUrls = array(); $vidSrcTypes = $this->GetVidSrcTypes(); if (preg_match('/(ytplayer\.config = )([^\r\n]+?)(;<\/script>)/', $file_contents, $matches) == 1) { $jsonObj = json_decode(trim($matches[2], ';')); if (isset($jsonObj->args->url_encoded_fmt_stream_map)) { $urls = urldecode(urldecode($jsonObj->args->url_encoded_fmt_stream_map)); //die($urls); if (preg_match('/^((.+?)(=))/', $urls, $matches) == 1) { $urlsArr = preg_split('/,'.preg_quote($matches[0], '/').'/', $urls, -1, PREG_SPLIT_NO_EMPTY); foreach ($urlsArr as $url) { if ($matches[0] != 'url=') { $url = ($url != $urlsArr[0]) ? $matches[0].$url : $url; $urlBase = preg_replace('/(.+?)(url=)(.+?)(\?)(.+)/', "$3$4", $url); $urlParams = preg_replace('/(.+?)(url=)(.+?)(\?)(.+)/', "$1$5", $url); $url = $urlBase . "&" . $urlParams; } else { $url = preg_replace('/^(url=)/', "", $url); } $url = preg_replace('/(.*)(itag=\d+&)(.*?)/', '$1$3', $url, 1); if (preg_match('/quality=small/',$url) != 1) { $url = preg_replace('/sig=/', "signature=", $url); $url = trim($url, ','); $url .= '&title=' . urlencode($this->ExtractSongTrackName($file_contents, $vidSrcTypes[0])); $url = preg_replace_callback('/(&type=)(.+?)(&)/', function($match){return $match[1].urlencode($match[2]).$match[3];}, $url); $vidUrls[] = $url; } } $vidUrls = array_reverse($vidUrls); //die(print_r($vidUrls)); } } } $this->_flvUrls = $vidUrls; } public function GetAudioQualities() { return $this->_audioQualities; } public function GetTempVidFileName() { return $this->_tempVidFileName; } private function SetTempVidFileName() { $this->_tempVidFileName = parent::_TEMPVIDDIR . $this->_uniqueID .'.flv'; } public function GetVidSrcTypes() { return $this->_vidSrcTypes; } public function GetUniqueID() { return $this->_uniqueID; } #endregion } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSkNi
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INCLUDE_OR_EVAL                                          'config.class.php', INCLUDE
    5     1        DECLARE_CLASS                                            'youtubetomp3converter', 'config'
  252     2      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FfSkNi%3A214%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSkNi
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  214     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 1
          2        INIT_FCALL                                               'urlencode'
          3        FETCH_DIM_R                                      ~2      !0, 2
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        CONCAT                                           ~4      ~1, $3
          7        FETCH_DIM_R                                      ~5      !0, 3
          8        CONCAT                                           ~6      ~4, ~5
          9      > RETURN                                                   ~6
         10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FfSkNi%3A214%240

Class YouTubeToMp3Converter:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSkNi
function name:  __construct
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'time'
          1        DO_ICALL                                         $1      
          2        CONCAT                                           ~2      $1, '_'
          3        INIT_FCALL                                               'uniqid'
          4        SEND_VAL                                                 ''
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $3      
          7        CONCAT                                           ~4      ~2, $3
          8        ASSIGN_OBJ                                               '_uniqueID'
          9        OP_DATA                                                  ~4
   19    10      > RETURN                                                   null

End of function __construct

Function downloadvideo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 29
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 29
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 29
filename:       /in/fSkNi
function name:  DownloadVideo
number of ops:  31
compiled vars:  !0 = $youTubeUrl, !1 = $file_contents
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        INIT_FCALL                                               'file_get_contents'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
   24     5        TYPE_CHECK                                  1018          !1
          6      > JMPZ                                                     ~4, ->29
   26     7    >   INIT_METHOD_CALL                                         'SetSongFileName'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
   27    10        INIT_METHOD_CALL                                         'SetFlvUrls'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
   28    13        INIT_METHOD_CALL                                         'GetSongFileName'
         14        DO_FCALL                                      0  $7      
         15        IS_NOT_EQUAL                                     ~8      $7, ''
         16      > JMPZ_EX                                          ~8      ~8, ->22
         17    >   INIT_METHOD_CALL                                         'GetFlvUrls'
         18        DO_FCALL                                      0  $9      
         19        COUNT                                            ~10     $9
         20        IS_SMALLER                                       ~11     0, ~10
         21        BOOL                                             ~8      ~11
         22    > > JMPZ                                                     ~8, ->29
   30    23    >   INIT_METHOD_CALL                                         'SaveVideo'
         24        INIT_METHOD_CALL                                         'GetFlvUrls'
         25        DO_FCALL                                      0  $12     
         26        SEND_VAR_NO_REF_EX                                       $12
         27        DO_FCALL                                      0  $13     
         28      > RETURN                                                   $13
   33    29    > > RETURN                                                   <false>
   34    30*     > RETURN                                                   null

End of function downloadvideo

Function generatemp3:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSkNi
function name:  GenerateMP3
number of ops:  90
compiled vars:  !0 = $audioQuality, !1 = $qualities, !2 = $quality, !3 = $exec_string, !4 = $ffmpegExecUrl, !5 = $postData, !6 = $ch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
   38     1        INIT_METHOD_CALL                                         'GetAudioQualities'
          2        DO_FCALL                                      0  $7      
          3        ASSIGN                                                   !1, $7
   39     4        INIT_FCALL                                               'in_array'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $9      
          8      > JMPZ                                                     $9, ->11
          9    >   QM_ASSIGN                                        ~10     !0
         10      > JMP                                                      ->13
         11    >   FETCH_DIM_R                                      ~11     !1, 1
         12        QM_ASSIGN                                        ~10     ~11
         13    >   ASSIGN                                                   !2, ~10
   40    14        FETCH_CLASS_CONSTANT                             ~13     '_FFMPEG'
         15        CONCAT                                           ~14     ~13, '+-i+'
         16        INIT_METHOD_CALL                                         'GetTempVidFileName'
         17        DO_FCALL                                      0  $15     
         18        CONCAT                                           ~16     ~14, $15
         19        CONCAT                                           ~17     ~16, '+-vol+'
         20        FETCH_CLASS_CONSTANT                             ~18     '_VOLUME'
         21        CONCAT                                           ~19     ~17, ~18
         22        CONCAT                                           ~20     ~19, '+-y+-acodec+libmp3lame+-ab+'
         23        CONCAT                                           ~21     ~20, !2
         24        CONCAT                                           ~22     ~21, 'k+'
         25        INIT_METHOD_CALL                                         'GetSongFileName'
         26        DO_FCALL                                      0  $23     
         27        CONCAT                                           ~24     ~22, $23
         28        CONCAT                                           ~25     ~24, '+2%3E+logs%2F'
         29        FETCH_OBJ_R                                      ~26     '_uniqueID'
         30        CONCAT                                           ~27     ~25, ~26
         31        CONCAT                                           ~28     ~27, '.txt'
         32        ASSIGN                                                   !3, ~28
   41    33        INIT_FCALL                                               'preg_replace'
         34        SEND_VAL                                                 '%2F%28%28%5B%5E%5C%2F%5D%2B%3F%29%28%5C.php%29%29%24%2F'
         35        SEND_VAL                                                 'exec_ffmpeg.php'
         36        FETCH_R                      global              ~30     '_SERVER'
         37        FETCH_DIM_R                                      ~31     ~30, 'HTTP_HOST'
         38        CONCAT                                           ~32     'http%3A%2F%2F', ~31
         39        FETCH_R                      global              ~33     '_SERVER'
         40        FETCH_DIM_R                                      ~34     ~33, 'PHP_SELF'
         41        CONCAT                                           ~35     ~32, ~34
         42        SEND_VAL                                                 ~35
         43        DO_ICALL                                         $36     
         44        ASSIGN                                                   !4, $36
   42    45        INIT_FCALL                                               'urlencode'
         46        SEND_VAR                                                 !3
         47        DO_ICALL                                         $38     
         48        CONCAT                                           ~39     'cmd%3D', $38
         49        ASSIGN                                                   !5, ~39
   43    50        INIT_FCALL_BY_NAME                                       'curl_init'
         51        DO_FCALL                                      0  $41     
         52        ASSIGN                                                   !6, $41
   44    53        INIT_FCALL_BY_NAME                                       'curl_setopt'
         54        SEND_VAR_EX                                              !6
         55        FETCH_CONSTANT                                   ~43     'CURLOPT_URL'
         56        SEND_VAL_EX                                              ~43
         57        SEND_VAR_EX                                              !4
         58        DO_FCALL                                      0          
   45    59        INIT_FCALL_BY_NAME                                       'curl_setopt'
         60        SEND_VAR_EX                                              !6
         61        FETCH_CONSTANT                                   ~45     'CURLOPT_POST'
         62        SEND_VAL_EX                                              ~45
         63        SEND_VAL_EX                                              <true>
         64        DO_FCALL                                      0          
   46    65        INIT_FCALL_BY_NAME                                       'curl_setopt'
         66        SEND_VAR_EX                                              !6
         67        FETCH_CONSTANT                                   ~47     'CURLOPT_POSTFIELDS'
         68        SEND_VAL_EX                                              ~47
         69        SEND_VAR_EX                                              !5
         70        DO_FCALL                                      0          
   47    71        INIT_FCALL_BY_NAME                                       'curl_setopt'
         72        SEND_VAR_EX                                              !6
         73        FETCH_CONSTANT                                   ~49     'CURLOPT_RETURNTRANSFER'
         74        SEND_VAL_EX                                              ~49
         75        SEND_VAL_EX                                              <true>
         76        DO_FCALL                                      0          
   48    77        INIT_FCALL_BY_NAME                                       'curl_setopt'
         78        SEND_VAR_EX                                              !6
         79        FETCH_CONSTANT                                   ~51     'CURLOPT_TIMEOUT'
         80        SEND_VAL_EX                                              ~51
         81        SEND_VAL_EX                                              1
         82        DO_FCALL                                      0          
   49    83        INIT_FCALL_BY_NAME                                       'curl_exec'
         84        SEND_VAR_EX                                              !6
         85        DO_FCALL                                      0          
   50    86        INIT_FCALL_BY_NAME                                       'curl_close'
         87        SEND_VAR_EX                                              !6
         88        DO_FCALL                                      0          
   51    89      > RETURN                                                   null

End of function generatemp3

Function downloadmp3:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 47
Branch analysis from position: 23
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/fSkNi
function name:  DownloadMP3
number of ops:  60
compiled vars:  !0 = $file, !1 = $filepath, !2 = $filename, !3 = $redirect
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   RECV                                             !0      
   55     1        FETCH_CLASS_CONSTANT                             ~4      '_SONGFILEDIR'
          2        INIT_FCALL                                               'urldecode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        CONCAT                                           ~6      ~4, $5
          6        ASSIGN                                                   !1, ~6
   56     7        INIT_FCALL                                               'urldecode'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
   57    11        FETCH_CLASS_CONSTANT                             ~10     '_ENABLE_CONCURRENCY_CONTROL'
         12      > JMPZ                                                     ~10, ->19
   59    13    >   INIT_FCALL                                               'preg_replace'
         14        SEND_VAL                                                 '%2F%28%28_uuid-%29%28%5Cw%7B13%7D%29%28%5C.mp3%29%29%24%2F'
         15        SEND_VAL                                                 '%244'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !2, $11
   61    19    >   INIT_FCALL                                               'is_file'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $13     
         22      > JMPZ                                                     $13, ->47
   63    23    >   INIT_FCALL                                               'header'
         24        SEND_VAL                                                 'Content-Type%3A+audio%2Fmpeg3'
         25        DO_ICALL                                                 
   64    26        INIT_FCALL                                               'header'
         27        INIT_FCALL                                               'filesize'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $15     
         30        CONCAT                                           ~16     'Content-Length%3A+', $15
         31        SEND_VAL                                                 ~16
         32        DO_ICALL                                                 
   65    33        INIT_FCALL                                               'header'
         34        CONCAT                                           ~18     'Content-Disposition%3A+attachment%3B+filename%3D%22', !2
         35        CONCAT                                           ~19     ~18, '%22'
         36        SEND_VAL                                                 ~19
         37        DO_ICALL                                                 
   66    38        INIT_FCALL                                               'ob_clean'
         39        DO_ICALL                                                 
   67    40        INIT_FCALL                                               'flush'
         41        DO_ICALL                                                 
   68    42        INIT_FCALL                                               'readfile'
         43        SEND_VAR                                                 !1
         44        DO_ICALL                                                 
   69    45      > EXIT                                                     
         46*       JMP                                                      ->59
   73    47    >   INIT_FCALL                                               'explode'
         48        SEND_VAL                                                 '%3F'
         49        FETCH_R                      global              ~24     '_SERVER'
         50        FETCH_DIM_R                                      ~25     ~24, 'REQUEST_URI'
         51        SEND_VAL                                                 ~25
         52        DO_ICALL                                         $26     
         53        ASSIGN                                                   !3, $26
   74    54        INIT_FCALL                                               'header'
         55        FETCH_DIM_R                                      ~28     !3, 0
         56        CONCAT                                           ~29     'Location%3A+', ~28
         57        SEND_VAL                                                 ~29
         58        DO_ICALL                                                 
   76    59      > RETURN                                                   null

End of function downloadmp3

Function extractsongtrackname:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 54
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 54
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 54
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 49
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
Branch analysis from position: 54
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 54
Branch analysis from position: 23
Branch analysis from position: 54
Branch analysis from position: 54
filename:       /in/fSkNi
function name:  ExtractSongTrackName
number of ops:  56
compiled vars:  !0 = $vidSrc, !1 = $srcType, !2 = $name, !3 = $vidSrcTypes, !4 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   78     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   80     2        ASSIGN                                                   !2, ''
   81     3        INIT_METHOD_CALL                                         'GetVidSrcTypes'
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !3, $6
   82     6        INIT_FCALL                                               'in_array'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $8      
         10      > JMPZ                                                     $8, ->54
   84    11    >   FETCH_DIM_R                                      ~9      !3, 1
         12        IS_EQUAL                                                 !1, ~9
         13      > JMPZ                                                     ~10, ->19
         14    >   INIT_FCALL                                               'file_get_contents'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $11     
         17        QM_ASSIGN                                        ~12     $11
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~12     !0
         20    >   ASSIGN                                                   !0, ~12
   85    21        TYPE_CHECK                                  1018          !0
         22      > JMPZ                                                     ~14, ->54
   87    23    >   INIT_FCALL                                               'preg_match'
         24        SEND_VAL                                                 '%2F%28%3Ctitle%3E%29%28.%2B%3F%29%28+-+YouTube%29%28%3C%5C%2Ftitle%3E%29%2F'
         25        SEND_VAR                                                 !0
         26        SEND_REF                                                 !4
         27        DO_ICALL                                         $15     
         28        IS_EQUAL                                                 $15, 1
         29      > JMPZ                                                     ~16, ->54
   89    30    >   INIT_FCALL                                               'trim'
         31        FETCH_DIM_R                                      ~17     !4, 2
         32        SEND_VAL                                                 ~17
         33        DO_ICALL                                         $18     
         34        ASSIGN                                                   !2, $18
   90    35        INIT_FCALL_BY_NAME                                       'iconv'
         36        SEND_VAL_EX                                              'UTF-8'
         37        SEND_VAL_EX                                              'ISO-8859-1%2F%2FTRANSLIT'
         38        SEND_VAR_EX                                              !2
         39        DO_FCALL                                      0  $20     
         40        ASSIGN                                                   !2, $20
   91    41        ISSET_ISEMPTY_CV                                 ~22     !2
         42        BOOL_NOT                                         ~23     ~22
         43      > JMPZ                                                     ~23, ->49
         44    >   INIT_FCALL                                               'html_entity_decode'
         45        SEND_VAR                                                 !2
         46        DO_ICALL                                         $24     
         47        QM_ASSIGN                                        ~25     $24
         48      > JMP                                                      ->53
         49    >   INIT_FCALL                                               'time'
         50        DO_ICALL                                         $26     
         51        CONCAT                                           ~27     'unknown_', $26
         52        QM_ASSIGN                                        ~25     ~27
         53    >   ASSIGN                                                   !2, ~25
   95    54    > > RETURN                                                   !2
   96    55*     > RETURN                                                   null

End of function extractsongtrackname

Function extractvideoid:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 15
filename:       /in/fSkNi
function name:  ExtractVideoId
number of ops:  21
compiled vars:  !0 = $youTubeUrl, !1 = $v, !2 = $urlQueryStr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   98     0  E >   RECV                                             !0      
  100     1        ASSIGN                                                   !1, ''
  101     2        INIT_FCALL                                               'parse_url'
          3        INIT_FCALL                                               'trim'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        SEND_VAL                                                 6
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !2, $5
  102    10        TYPE_CHECK                                  1018  ~7      !2
         11      > JMPZ_EX                                          ~7      ~7, ->15
         12    >   ISSET_ISEMPTY_CV                                 ~8      !2
         13        BOOL_NOT                                         ~9      ~8
         14        BOOL                                             ~7      ~9
         15    > > JMPZ                                                     ~7, ->19
  104    16    >   INIT_FCALL                                               'parse_str'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
  106    19    > > RETURN                                                   !1
  107    20*     > RETURN                                                   null

End of function extractvideoid

Function updatevideodownloadprogress:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/fSkNi
function name:  UpdateVideoDownloadProgress
number of ops:  25
compiled vars:  !0 = $downloadSize, !1 = $downloaded, !2 = $uploadSize, !3 = $uploaded, !4 = $percent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  109     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
  111     4        INIT_FCALL                                               'round'
          5        DIV                                              ~5      !1, !0
          6        SEND_VAL                                                 ~5
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $6      
          9        MUL                                              ~7      $6, 100
         10        ASSIGN                                                   !4, ~7
  112    11        FETCH_OBJ_R                                      ~9      '_percentVidDownloaded'
         12        IS_SMALLER                                               ~9, !4
         13      > JMPZ                                                     ~10, ->24
  114    14    >   PRE_INC_OBJ                                              '_percentVidDownloaded'
  115    15        CONCAT                                           ~12     '%3Cscript+type%3D%22text%2Fjavascript%22%3EupdateVideoDownloadProgress%28%22', !4
         16        CONCAT                                           ~13     ~12, '%22%29%3B%3C%2Fscript%3E'
         17        ECHO                                                     ~13
  116    18        INIT_FCALL                                               'ob_end_flush'
         19        DO_ICALL                                                 
  117    20        INIT_FCALL                                               'ob_flush'
         21        DO_ICALL                                                 
  118    22        INIT_FCALL                                               'flush'
         23        DO_ICALL                                                 
  120    24    > > RETURN                                                   null

End of function updatevideodownloadprogress

Function savevideo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 93
Branch analysis from position: 93
2 jumps found. (Code = 46) Position 1 = 95, Position 2 = 99
Branch analysis from position: 95
2 jumps found. (Code = 44) Position 1 = 100

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
267.35 ms | 1428 KiB | 58 Q