3v4l.org

run code in 300+ PHP versions simultaneously
<?php class youtube { var $conn = false; var $username = ""; var $password = ""; var $error = false; function get($url) { $this->conn = new Curl('youtube'); $html = $this->conn->get($url); if(strstr($html,'verify-age-thumb')) { $this->error = "Adult Video Detected"; return false; } if(strstr($html,'das_captcha')) { $this->error = "Captcah Found please run on diffrent server"; return false; } if(!preg_match('/stream_map=(.[^&]*?)&/i',$html,$match)) { $this->error = "Error Locating Downlod URL's"; return false; } if(!preg_match('/stream_map=(.[^&]*?)(?:\\\\|&)/i',$html,$match)) { return false; } $fmt_url = urldecode($match[1]); $urls = explode(',',$fmt_url); $foundArray = array(); foreach($urls as $url) { if(preg_match('/itag=([0-9]+)/',$url,$tm) && preg_match('/sig=(.*?)&/', $url , $si) && preg_match('/url=(.*?)&/', $url , $um)) { $u = urldecode($um[1]); $foundArray[$tm[1]] = $u.'&signature='.$si[1]; } } $typeMap = array(); $typeMap[13] = array("13", "3GP", "Low Quality - 176x144"); $typeMap[17] = array("17", "3GP", "Medium Quality - 176x144"); $typeMap[36] = array("36", "3GP", "High Quality - 320x240"); $typeMap[5] = array("5", "FLV", "Low Quality - 400x226"); $typeMap[6] = array("6", "FLV", "Medium Quality - 640x360"); $typeMap[34] = array("34", "FLV", "Medium Quality - 640x360"); $typeMap[35] = array("35", "FLV", "High Quality - 854x480"); $typeMap[43] = array("43", "WEBM", "Low Quality - 640x360"); $typeMap[44] = array("44", "WEBM", "Medium Quality - 854x480"); $typeMap[45] = array("45", "WEBM", "High Quality - 1280x720"); $typeMap[18] = array("18", "MP4", "Medium Quality - 480x360"); $typeMap[22] = array("22", "MP4", "High Quality - 1280x720"); $typeMap[37] = array("37", "MP4", "High Quality - 1920x1080"); $typeMap[33] = array("38", "MP4", "High Quality - 4096x230"); $videos = array(); foreach($typeMap as $format => $meta) { if (isset($foundArray[$format])) { $videos[] = array('ext' => strtolower($meta[1]) , 'type' => $meta[2], 'url' => $foundArray[$format]); } } return $videos; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eDeO7
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   84     0  E > > RETURN                                                   1

Class youtube:
Function get:
Finding entry points
Branch analysis from position: 0
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
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 45
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 77) Position 1 = 57, Position 2 = 90
Branch analysis from position: 57
2 jumps found. (Code = 78) Position 1 = 58, Position 2 = 90
Branch analysis from position: 58
2 jumps found. (Code = 46) Position 1 = 64, Position 2 = 70
Branch analysis from position: 64
2 jumps found. (Code = 46) Position 1 = 71, Position 2 = 77
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 89
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 89
Branch analysis from position: 77
Branch analysis from position: 70
Branch analysis from position: 90
2 jumps found. (Code = 77) Position 1 = 122, Position 2 = 138
Branch analysis from position: 122
2 jumps found. (Code = 78) Position 1 = 123, Position 2 = 138
Branch analysis from position: 123
2 jumps found. (Code = 43) Position 1 = 126, Position 2 = 137
Branch analysis from position: 126
1 jumps found. (Code = 42) Position 1 = 122
Branch analysis from position: 122
Branch analysis from position: 137
Branch analysis from position: 138
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 138
Branch analysis from position: 90
filename:       /in/eDeO7
function name:  get
number of ops:  141
compiled vars:  !0 = $url, !1 = $html, !2 = $match, !3 = $fmt_url, !4 = $urls, !5 = $foundArray, !6 = $tm, !7 = $si, !8 = $um, !9 = $u, !10 = $typeMap, !11 = $videos, !12 = $meta, !13 = $format
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        NEW                                              $15     'Curl'
          2        SEND_VAL_EX                                              'youtube'
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'conn'
          5        OP_DATA                                                  $15
   13     6        FETCH_OBJ_R                                      ~17     'conn'
          7        INIT_METHOD_CALL                                         ~17, 'get'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $18     
         10        ASSIGN                                                   !1, $18
   15    11        INIT_FCALL                                               'strstr'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 'verify-age-thumb'
         14        DO_ICALL                                         $20     
         15      > JMPZ                                                     $20, ->19
   17    16    >   ASSIGN_OBJ                                               'error'
         17        OP_DATA                                                  'Adult+Video+Detected'
   18    18      > RETURN                                                   <false>
   21    19    >   INIT_FCALL                                               'strstr'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 'das_captcha'
         22        DO_ICALL                                         $22     
         23      > JMPZ                                                     $22, ->27
   23    24    >   ASSIGN_OBJ                                               'error'
         25        OP_DATA                                                  'Captcah+Found+please+run+on+diffrent+server'
   24    26      > RETURN                                                   <false>
   27    27    >   INIT_FCALL                                               'preg_match'
         28        SEND_VAL                                                 '%2Fstream_map%3D%28.%5B%5E%26%5D%2A%3F%29%26%2Fi'
         29        SEND_VAR                                                 !1
         30        SEND_REF                                                 !2
         31        DO_ICALL                                         $24     
         32        BOOL_NOT                                         ~25     $24
         33      > JMPZ                                                     ~25, ->37
   29    34    >   ASSIGN_OBJ                                               'error'
         35        OP_DATA                                                  'Error+Locating+Downlod+URL%27s'
   30    36      > RETURN                                                   <false>
   33    37    >   INIT_FCALL                                               'preg_match'
         38        SEND_VAL                                                 '%2Fstream_map%3D%28.%5B%5E%26%5D%2A%3F%29%28%3F%3A%5C%5C%7C%26%29%2Fi'
         39        SEND_VAR                                                 !1
         40        SEND_REF                                                 !2
         41        DO_ICALL                                         $27     
         42        BOOL_NOT                                         ~28     $27
         43      > JMPZ                                                     ~28, ->45
   35    44    > > RETURN                                                   <false>
   38    45    >   INIT_FCALL                                               'urldecode'
         46        FETCH_DIM_R                                      ~29     !2, 1
         47        SEND_VAL                                                 ~29
         48        DO_ICALL                                         $30     
         49        ASSIGN                                                   !3, $30
   40    50        INIT_FCALL                                               'explode'
         51        SEND_VAL                                                 '%2C'
         52        SEND_VAR                                                 !3
         53        DO_ICALL                                         $32     
         54        ASSIGN                                                   !4, $32
   42    55        ASSIGN                                                   !5, <array>
   44    56      > FE_RESET_R                                       $35     !4, ->90
         57    > > FE_FETCH_R                                               $35, !0, ->90
   46    58    >   INIT_FCALL                                               'preg_match'
         59        SEND_VAL                                                 '%2Fitag%3D%28%5B0-9%5D%2B%29%2F'
         60        SEND_VAR                                                 !0
         61        SEND_REF                                                 !6
         62        DO_ICALL                                         $36     
         63      > JMPZ_EX                                          ~37     $36, ->70
         64    >   INIT_FCALL                                               'preg_match'
         65        SEND_VAL                                                 '%2Fsig%3D%28.%2A%3F%29%26%2F'
         66        SEND_VAR                                                 !0
         67        SEND_REF                                                 !7
         68        DO_ICALL                                         $38     
         69        BOOL                                             ~37     $38
         70    > > JMPZ_EX                                          ~37     ~37, ->77
         71    >   INIT_FCALL                                               'preg_match'
         72        SEND_VAL                                                 '%2Furl%3D%28.%2A%3F%29%26%2F'
         73        SEND_VAR                                                 !0
         74        SEND_REF                                                 !8
         75        DO_ICALL                                         $39     
         76        BOOL                                             ~37     $39
         77    > > JMPZ                                                     ~37, ->89
   48    78    >   INIT_FCALL                                               'urldecode'
         79        FETCH_DIM_R                                      ~40     !8, 1
         80        SEND_VAL                                                 ~40
         81        DO_ICALL                                         $41     
         82        ASSIGN                                                   !9, $41
   49    83        FETCH_DIM_R                                      ~43     !6, 1
         84        CONCAT                                           ~45     !9, '%26signature%3D'
         85        FETCH_DIM_R                                      ~46     !7, 1
         86        CONCAT                                           ~47     ~45, ~46
         87        ASSIGN_DIM                                               !5, ~43
         88        OP_DATA                                                  ~47
   44    89    > > JMP                                                      ->57
         90    >   FE_FREE                                                  $35
   53    91        ASSIGN                                                   !10, <array>
   55    92        ASSIGN_DIM                                               !10, 13
         93        OP_DATA                                                  <array>
   56    94        ASSIGN_DIM                                               !10, 17
         95        OP_DATA                                                  <array>
   57    96        ASSIGN_DIM                                               !10, 36
         97        OP_DATA                                                  <array>
   58    98        ASSIGN_DIM                                               !10, 5
         99        OP_DATA                                                  <array>
   59   100        ASSIGN_DIM                                               !10, 6
        101        OP_DATA                                                  <array>
   60   102        ASSIGN_DIM                                               !10, 34
        103        OP_DATA                                                  <array>
   61   104        ASSIGN_DIM                                               !10, 35
        105        OP_DATA                                                  <array>
   62   106        ASSIGN_DIM                                               !10, 43
        107        OP_DATA                                                  <array>
   63   108        ASSIGN_DIM                                               !10, 44
        109        OP_DATA                                                  <array>
   64   110        ASSIGN_DIM                                               !10, 45
        111        OP_DATA                                                  <array>
   65   112        ASSIGN_DIM                                               !10, 18
        113        OP_DATA                                                  <array>
   66   114        ASSIGN_DIM                                               !10, 22
        115        OP_DATA                                                  <array>
   67   116        ASSIGN_DIM                                               !10, 37
        117        OP_DATA                                                  <array>
   68   118        ASSIGN_DIM                                               !10, 33
        119        OP_DATA                                                  <array>
   71   120        ASSIGN                                                   !11, <array>
   73   121      > FE_RESET_R                                       $64     !10, ->138
        122    > > FE_FETCH_R                                       ~65     $64, !12, ->138
        123    >   ASSIGN                                                   !13, ~65
   74   124        ISSET_ISEMPTY_DIM_OBJ                         0          !5, !13
        125      > JMPZ                                                     ~67, ->137
   75   126    >   INIT_FCALL                                               'strtolower'
        127        FETCH_DIM_R                                      ~69     !12, 1
        128        SEND_VAL                                                 ~69
        129        DO_ICALL                                         $70     
        130        INIT_ARRAY                                       ~71     $70, 'ext'
        131        FETCH_DIM_R                                      ~72     !12, 2
        132        ADD_ARRAY_ELEMENT                                ~71     ~72, 'type'
        133        FETCH_DIM_R                                      ~73     !5, !13
        134        ADD_ARRAY_ELEMENT                                ~71     ~73, 'url'
        135        ASSIGN_DIM                                               !11
        136        OP_DATA                                                  ~71
   73   137    > > JMP                                                      ->122
        138    >   FE_FREE                                                  $64
   79   139      > RETURN                                                   !11
   82   140*     > RETURN                                                   null

End of function get

End of class youtube.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.79 ms | 1408 KiB | 23 Q