Example #1
0
def main(args):
    flickr = FlickrTools(args.api_key, args.api_secret, args.token, args.token_secret)

    albums = flickr.albums()
    for _, album_name in albums:
        print("downloading", album_name)
        download_album(album_name, flickr)
Example #2
0
def main(args):
    LOG.debug("flickr pic 2 album started")
    albumname = args.album_name if args.album_name else "Auto Upload"
    flickr = FlickrTools(args.api_key, args.api_secret, args.token,
                         args.token_secret)
    set_id = flickr.photoset_id(albumname)
    pics = flickr.pictures_in_photoset(set_id)

    for pic in pics:
        album = get_album(pic['title'])
        LOG.debug("album {} for {}".format(album, pic['title']))
        if album:
            add_pic_to_album(pic, album, flickr)
Example #3
0
def main(args):
    base_folder = args.folder
    flickr = FlickrTools(args.api_key, args.api_secret, args.token,
                         args.token_secret)

    pic_paths = flatten([[
        os.path.join(root, file) for file in files
        if file.lower().endswith(".jpg")
    ] for root, dirs, files in os.walk(base_folder)])

    for path in pic_paths:
        upload_path(path, flickr)
def main(args):
    set_name = args.album_name
    tag = args.tag if args.tag else "duplicate"

    flickr = FlickrTools(args.api_key, args.api_secret, args.token,
                         args.token_secret)

    set_id = flickr.photoset_id(set_name)
    pics = [p['id'] for p in flickr.pictures_in_photoset(set_id)]
    for picture_id in pics:
        if contains_tag(picture_id, tag, flickr):
            print("remove", picture_id, "from", set_id)
            flickr.remove_from_set(picture_id, set_id)
Example #5
0
def main(args):
    FlickrTools(args.api_key, args.api_secret)
def main(args):
    set_name = args.album_name

    flickr = FlickrTools(args.api_key, args.api_secret, args.token,
                         args.token_secret)

    set_id = flickr.photoset_id(set_name)
    pics = [p['id'] for p in flickr.pictures_in_photoset(set_id)]

    hashes = []
    for pic_id in pics:
        try:
            md5_hash = flickr.hash_by_photoid(pic_id)
        except:
            print("error during gathering hash of", pic_id)

        if md5_hash:
            if md5_hash in hashes:

                print("tagged", pic_id)

                if args.tag:
                    tags = args.tag.split(",")
                    for tag in tags:
                        flickr.add_tag(pic_id, tag)
                else:
                    flickr.add_tag(pic_id, "duplicate")
                    flickr.add_tag(pic_id, "duplicate_in_" + set_name)
            else:
                hashes.append(md5_hash)
def main(args):
    flickr = FlickrTools(args.api_key, args.api_secret, args.token,
                         args.token_secret)
    for album in args.album:
        download_album(album, flickr)