jeckman / YouTube-Downloader

PHP script for downloading videos from youtube; also parsing youtube feed into RSS enclosures for podcatchers
GNU General Public License v2.0
895 stars 473 forks source link

Parse error: syntax error, unexpected 'else' (T_ELSE) in getvideo.php on line 224 #105

Closed ckc closed 8 years ago

ckc commented 9 years ago

when entered video ID , shown the following msg: Parse error: syntax error, unexpected 'else' (T_ELSE) in getvideo.php on line 224

jeckman commented 9 years ago

What are you entering for the VideoID? I've not seen that error before on any of my installs.

ckc commented 9 years ago

also tried example ID also error btw. I used MAMP Pro in OSX

jeckman commented 9 years ago

Are there any errors in your PHP log? Might be related to not having cUrl installed

See http://blog-en.mamp.info/2009/09/how-to-show-your-mamp-logs-within.html

Diloy93 commented 9 years ago

you can fix it adding { } in the code:

    if($config['VideoLinkMode']=='direct'||$config['VideoLinkMode']=='both'){
      $directlink = explode('.googlevideo.com/',$avail_formats[$i]['url']);
      $directlink = 'http://redirector.googlevideo.com/' . $directlink[1] . '';
      echo '<a href="' . $directlink . '&title='.$cleanedtitle.'" class="mime">' . $avail_formats[$i]['type'] . '</a> ';}
    else{
      echo '<span class="mime">' . $avail_formats[$i]['type'] . '</span> ';
      echo '<small>(' .  $avail_formats[$i]['quality'];}
jeckman commented 9 years ago

@Diloy93 can you make a pull request?

ckc commented 9 years ago

@Diloy93 Thx guy. I know need a pair {} but no idea put it where lol

hedii commented 9 years ago

@Diloy93 see https://github.com/jeckman/YouTube-Downloader/pull/106/files

jeckman commented 8 years ago

This pull request was merged.