add support for Google+ (plus.google.com) #141

Closed
opened 2026-02-20 22:26:22 -05:00 by deekerman · 3 comments
Owner

Originally created by @ghost on GitHub (Oct 26, 2011).

Google+ becomes more and more popular. Please support this host also. Thanks

youtube-dl -t https://plus.google.com/111962077049890418486/posts/EJxn8T21H5o
WARNING: Falling back on generic information extractor.
[generic] EJxn8T21H5o: Downloading webpage
[generic] EJxn8T21H5o: Extracting information
ERROR: Invalid URL: https://plus.google.com/111962077049890418486/posts/EJxn8T21H5o

Originally created by @ghost on GitHub (Oct 26, 2011). Google+ becomes more and more popular. Please support this host also. Thanks > youtube-dl -t https://plus.google.com/111962077049890418486/posts/EJxn8T21H5o > WARNING: Falling back on generic information extractor. > [generic] EJxn8T21H5o: Downloading webpage > [generic] EJxn8T21H5o: Extracting information > ERROR: Invalid URL: https://plus.google.com/111962077049890418486/posts/EJxn8T21H5o
deekerman 2026-02-20 22:26:22 -05:00
Author
Owner

@ghost commented on GitHub (Jun 23, 2012):

any progress?

@ghost commented on GitHub (Jun 23, 2012): any progress?
Author
Owner

@kevinamadeus commented on GitHub (Aug 23, 2012):

I personally use Google+ a lot, and I have written php script myself to extract the video link, and download using wget. I think this may be ported to Python...

/*
 * The post. By clicking the date of a post in a stream
 * Post has to be public
 * for example, $post_url = "https://plus.google.com/100853242536124656213/posts/EDSBssT7zLm"
 */
$post_html = file_get_contents($post_url);

    /* Time, for output file name */
    $time_pattern = '%title\="Timestamp"\>(.*?)\</a\>%';
    if (preg_match($time_pattern, $post_html, $matches)) {
        $time = date('ymd', strtotime($matches[1]));
    } else {
        $time = date('ymd') . 'F';
    }

    /* Description, for output file name */
    $desc_pattern = '%<meta name\="Description" content\="(.*?)[\s<"]%';
    if (preg_match($desc_pattern, $post_html, $matches)) {
        $desc = $matches[1];
    } else {
        $desc = 'No desc';
    }

    /* Author, for output file name */
    $author_pattern = '%rel\="author".*?>(.*?)</a>%';
    if (preg_match($author_pattern, $post_html, $matches)) {
        $author = $matches[1];
    } else {
        $author = 'No author';
    }
/*
 * Simulate clicking the image of a video post
 */
$image_box_pattern = '%"(https\://plus\.google\.com/photos/.*?)",,"image/jpeg","video"\]%';
if (preg_match($image_box_pattern, $post_html, $matches)) {
    $image_box_url = $matches[1];
    $image_box_html = file_get_contents($image_box_url);
} else {
    die('Cannot find the image box');
}

/*
 * Extract video links of all sizes
 */
if (preg_match_all('%\d+,\d+,(\d+),"(http\://redirector\.googlevideo\.com.*?)"%',$image_box_html,$matches)) {
    /* Prepare function to decode \u0026 like hex */
    function unescapeUTF8EscapeSeq($str) {
        return preg_replace_callback("/\\\u([0-9a-f]{4})/i",
            create_function('$matches',
                'return html_entity_decode(\'&#x\'.$matches[1].\';\', ENT_QUOTES, \'UTF-8\');'
            ), $str);
    }

    /* Put them into an array */
    $video_links = array();
    for ($i=0; $i<count($matches[1]); $i++) {
        $video_links[$matches[1][$i]] = unescapeUTF8EscapeSeq($matches[2][$i]);
    }

    /* Sort the best quality first*/
    krsort($video_links);
    foreach ($video_links as $video_link) {
        $video_to_download = $video_link;
        break; /* Only taking the first one */
    }
} else {
    die('No video found');
}

/*
 * Formulate command
 */
echo PHP_EOL . "screen wget -O \"Downloads/$time - $author - $desc.flv\" \"$video_link\"" . PHP_EOL . PHP_EOL;

@kevinamadeus commented on GitHub (Aug 23, 2012): I personally use Google+ a lot, and I have written php script myself to extract the video link, and download using wget. I think this may be ported to Python... ``` php /* * The post. By clicking the date of a post in a stream * Post has to be public * for example, $post_url = "https://plus.google.com/100853242536124656213/posts/EDSBssT7zLm" */ $post_html = file_get_contents($post_url); /* Time, for output file name */ $time_pattern = '%title\="Timestamp"\>(.*?)\</a\>%'; if (preg_match($time_pattern, $post_html, $matches)) { $time = date('ymd', strtotime($matches[1])); } else { $time = date('ymd') . 'F'; } /* Description, for output file name */ $desc_pattern = '%<meta name\="Description" content\="(.*?)[\s<"]%'; if (preg_match($desc_pattern, $post_html, $matches)) { $desc = $matches[1]; } else { $desc = 'No desc'; } /* Author, for output file name */ $author_pattern = '%rel\="author".*?>(.*?)</a>%'; if (preg_match($author_pattern, $post_html, $matches)) { $author = $matches[1]; } else { $author = 'No author'; } /* * Simulate clicking the image of a video post */ $image_box_pattern = '%"(https\://plus\.google\.com/photos/.*?)",,"image/jpeg","video"\]%'; if (preg_match($image_box_pattern, $post_html, $matches)) { $image_box_url = $matches[1]; $image_box_html = file_get_contents($image_box_url); } else { die('Cannot find the image box'); } /* * Extract video links of all sizes */ if (preg_match_all('%\d+,\d+,(\d+),"(http\://redirector\.googlevideo\.com.*?)"%',$image_box_html,$matches)) { /* Prepare function to decode \u0026 like hex */ function unescapeUTF8EscapeSeq($str) { return preg_replace_callback("/\\\u([0-9a-f]{4})/i", create_function('$matches', 'return html_entity_decode(\'&#x\'.$matches[1].\';\', ENT_QUOTES, \'UTF-8\');' ), $str); } /* Put them into an array */ $video_links = array(); for ($i=0; $i<count($matches[1]); $i++) { $video_links[$matches[1][$i]] = unescapeUTF8EscapeSeq($matches[2][$i]); } /* Sort the best quality first*/ krsort($video_links); foreach ($video_links as $video_link) { $video_to_download = $video_link; break; /* Only taking the first one */ } } else { die('No video found'); } /* * Formulate command */ echo PHP_EOL . "screen wget -O \"Downloads/$time - $author - $desc.flv\" \"$video_link\"" . PHP_EOL . PHP_EOL; ```
Author
Owner

@FiloSottile commented on GitHub (Dec 17, 2012):

We have it!

@FiloSottile commented on GitHub (Dec 17, 2012): We have it!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#141
No description provided.