6

https://support.google.com/picasa/answer/6558?hl=en says:

Google+ Photos: Only photos over 2048 x 2048 pixels and videos longer than 15 minutes count towards your storage limit.

In order to make space in my account, I'd like to list all my videos longer than 15 minutes in my Google+ Photo account.

I'm therefore looking for a program/extension/userscript software to my +15-minute videos in Google+. (if possible free and supporting Windows 7).

3
  • Do you want it to analyze your online Google account or would analyzing your GoogleDrive Folder on your computer be acceptable? Apr 26 '14 at 22:30
  • 1
    Online Google account if possible. But I'm curious: have Google+ photos/videos have their own folder in Gdrive? Apr 26 '14 at 22:31
  • oh hmm I didn't read that very well - I was thinking you were saying photos/videos in GDrive rather than Google+. I don't actually know - would be handy in some ways if so. Apr 26 '14 at 22:34
2

This is the closest I've got to solving the same problem I had.

Ref: http://muzso.hu/2012/02/26/list-photos-and-videos-from-picasa-web-albums-google-that-are-over-a-specified-width-heig

The attached Python script helps you with this. It should be run from the commandline with a Picasa Web Ablums or Google+ username as its first parameter and it'll list all (public) photos and videos that are over the limit for the unlimited storage pool. At the time of writing the limit is 2048 pixels for photographs and 15 minutes for videos for Google+ users and these are the defaults for the script as well (but you can specify your own limits on the commandline as second and third arguments).

Actually you can use the optional 2nd and 3rd arguments (with a value of zero) to list all photos and videos (it'll print their dimensions and sizes too) in a Picasa Web Albums or Google+ account. Might come handy if you want a full listing of all your (public) uploads.

Link to Code: http://muzso.hu/dfiles/public/google_photos_over_limit.py

#!/usr/bin/env python

#
# This script will go through all the public photos and videos of the specified
# PicasaWeb or Google+ user and list those that fall into the limited category
# (ie. for photos: width or height is over 2048 pixels
#      for videos: duration is over 15 minutes )
#
# For Picasa users without a Google+ registration the photo size limit is
# 800x800. To support these users too, you can specify the max. photo dimension
# and video duration for the unlimited storage pool as second and third
# parameters of this script.
#
# Version:       1.0
#
# Author:        muzso, 2012.02.25 (http://muzso.hu/)
# License:       GPLv2
#

import sys
import xml.dom.minidom
import urllib2

DIM_LIMIT = 2048
DUR_LIMIT = 900

def getText(nodelist):
    ret = ""
    for node in nodelist.childNodes:
        if node.nodeType == xml.dom.Node.TEXT_NODE:
            ret += node.data
    return ret.encode("utf-8")

######## Main Application ##########
if __name__ == "__main__":

    # PicasaWeb username is expected
    if len(sys.argv) < 2:
        sys.stderr.write("usage: %s <Google username> [max_photo_dimension [max_video_duration]]\n" % sys.argv[0])
        sys.exit(1)

    if len(sys.argv) >= 3:
        try:
            DIM_LIMIT = int(sys.argv[2])
        except ValueError:
            sys.stderr.write("Failed to convert \"%s\" to a number. The second parameter should be an integer specifying the maximum dimensions of photos counted into free storage.\n" % sys.argv[2])
            sys.exit(2)

        if len(sys.argv) >= 4:
            try:
                DUR_LIMIT = int(sys.argv[3])
            except ValueError:
                sys.stderr.write("The third parameter should be an integer specifying the maximum duration of videos counted into free storage.\n")
                sys.exit(3)

    print "Max. photo dimension (over which photos will be listed): %s" % DIM_LIMIT
    print "Max. video duration (over which videos will be listed): %s" % DUR_LIMIT

    baseurl = "http://picasaweb.google.com/data/feed/api/user/";

    url = baseurl + sys.argv[1]
    resp = urllib2.urlopen(url)
    dom = xml.dom.minidom.parse(resp)
    albums = dom.getElementsByTagName("entry")
    print "Found %s albums" % albums.length

    # replace username with id in the url
    url = baseurl + getText(dom.getElementsByTagName("gphoto:user")[0])

    tpiccount = 0
    tpicsize = 0
    tvidcount = 0
    tvidsize = 0

    for album in albums:
        albumid = getText(album.getElementsByTagName("gphoto:id")[0])
        albumname = getText(album.getElementsByTagName("title")[0])

        aurl = url + "/albumid/" + albumid
        resp = urllib2.urlopen(aurl)
        dom2 = xml.dom.minidom.parse(resp)

        entries = dom2.getElementsByTagName("entry")

        print "Processing album \"%s\" (has %s elements) ..." % (albumname, entries.length)

        piccount = 0
        picsize = 0
        vidcount = 0
        vidsize = 0

        for entry in entries:
            video = entry.getElementsByTagName("gphoto:originalvideo")
            if video.length > 0:
                dur = video[0].getAttribute("duration")
                if (dur != ""):
                    try:
                        dur = int(dur)
                        if dur > DUR_LIMIT:
                            vidcount += 1

                            size = getText(entry.getElementsByTagName("gphoto:size")[0])
                            try:
                                size = int(size)
                                vidsize += size
                            except ValueError:
                                sys.stderr.write("    \"%s\": failed to convert video size \"%s\" to a number\n" % (getText(entry.getElementsByTagName("title")[0]), size))
                                size = -1

                            print "  \"%s\": video duration = %s, size = %s" % (getText(entry.getElementsByTagName("title")[0]), dur, size)
                    except ValueError:
                        sys.stderr.write("    \"%s\": failed to convert video duration \"%s\" to a number\n" % (getText(entry.getElementsByTagName("title")[0]), dur))
            else:
                width = getText(entry.getElementsByTagName("gphoto:width")[0])
                try:
                    width = int(width)
                except ValueError:
                    sys.stderr.write("    \"%s\": failed to convert photo width \"%s\" to a number\n" % (getText(entry.getElementsByTagName("title")[0]), width))
                    width = -1

                height = getText(entry.getElementsByTagName("gphoto:height")[0])
                try:
                    height = int(height)
                except ValueError:
                    sys.stderr.write("    \"%s\": failed to convert photo height \"%s\" to a number\n" % (getText(entry.getElementsByTagName("title")[0]), height))
                    height = -1

                if width > DIM_LIMIT or height > DIM_LIMIT:
                    piccount += 1

                    size = getText(entry.getElementsByTagName("gphoto:size")[0])
                    try:
                        size = int(size)
                        picsize += size
                    except ValueError:
                        sys.stderr.write("    \"%s\": failed to convert size \"%s\" to a number\n" % (getText(entry.getElementsByTagName("title")[0]), size))
                        size = -1

                    print "  \"%s\": photo width = %s, height = %s, size = %s" % (getText(entry.getElementsByTagName("title")[0]), width, height, size)

            sys.stdout.flush()
            sys.stderr.flush()

        if piccount > 0:
            print "  Number and size of photos over the limit in \"%s\": %s (%s bytes)" % (albumname, piccount, picsize)
        if vidcount > 0:
            print "  Number and size of videos over the limit in \"%s\": %s (%s bytes)" % (albumname, vidcount, vidsize)

        tpiccount += piccount
        tpicsize += picsize
        tvidcount += vidcount
        tvidsize += vidsize

    if tpiccount > 0 or tvidcount > 0:
        if tpiccount > 0:
            print "Number and total size of photos with a dimension that is over the specified limit: %s (%s bytes)" % (tpiccount, tpicsize)
        if tvidcount > 0:
            print "Number and total size of videos with a duration that is over the specified limit: %s (%s bytes)" % (tvidcount, tvidsize)
    else:
        print "No photos or videos were found with a width, height or duration over the specidied limits."
1
  • Were you able to use the script? I have a similar problem and would like to check the size of photos and videos (all private). Would you recommend this Python script? How best should I run it (never having used Python?)
    – user13087
    Mar 16 '15 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.