Support » Plugin: Broken Link Checker » Problem with Autoplay YT URLs

Viewing 1 replies (of 1 total)
  • Here is the fix for this little problem (modules/extra/youtube.php):

    //Extract the video or playlist ID from the URL
    $video_id = $playlist_id = null;
    if ( strtolower($components[‘host’]) === ‘youtu.be’ ) {
    $video_id = trim($components[‘path’], ‘/’);
    } else if ( (strpos($components[‘path’], ‘watch’) !== false) && isset($query[‘v’]) ) {
    $video_id = $query[‘v’];

    if (strpos($video_id, ‘?autoplay=1’) !== false) {
    $video_id = str_replace (‘?autoplay=1’, ”, $video_id);
    }
    } else if ( $components[‘path’] == ‘/playlist’ ) {
    $playlist_id = $query[‘list’];
    } else if ( $components[‘path’] == ‘/view_play_list’ ) {
    $playlist_id = $query[‘p’];
    }

    if ( empty($playlist_id) && empty($video_id) ) {
    $result[‘status_text’] = ‘Unsupported URL Syntax’;
    $result[‘status_code’] = BLC_LINK_STATUS_UNKNOWN;
    return $result;
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with Autoplay YT URLs’ is closed to new replies.