# -*- coding: utf-8 -*-

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

from gallery_dl.extractor import imageshack


__tests__ = (
{
    "#url"     : "https://imageshack.com/i/iq8ac04fj",
    "#class"   : imageshack.ImageshackImageExtractor,
    "#results" : "https://imagizer.imageshack.com/img674/3530/8ac04f.jpg",

    "adult_content" : False,
    "block_downloading": False,
    "bucket"        : 3530,
    "comments_count": 0,
    "comments_disabled": True,
    "copyright"     : "",
    "creation_date" : 1405450816,
    "date"          : "dt:2014-07-15 19:00:16",
    "description"   : "",
    "direct_link"   : "imagizer.imageshack.com/img674/3530/8ac04f.jpg",
    "extension"     : "jpg",
    "featured"      : False,
    "filename"      : "247fa952439aa690b7d28494f88b8c2b",
    "filesize"      : 81,
    "filter"        : 0,
    "height"        : 512,
    "id"            : "iq8ac04fj",
    "is_owner"      : False,
    "liked"         : False,
    "likes"         : 0,
    "moderated"     : False,
    "next_images"   : [],
    "original_filename": "247fa952439aa690b7d28494f88b8c2b.jpg",
    "prev_images"   : [],
    "public"        : True,
    "server"        : 674,
    "title"         : "Up in the treetops",
    "width"         : 364,
    "tags"          : [
        "childhood",
        "happy",
        "life",
        "moment",
        "photography",
        "space",
        "special",
        "tree",
        "treehouse",
    ],
    "owner"         : {
        "allow_following": False,
        "featured_photographer": False,
        "membership"     : "free",
        "username"       : "TomKovilick",
    },
},

{
    "#url"     : "https://imageshack.com/i/f00b3lg2j",
    "#class"   : imageshack.ImageshackImageExtractor,
    "#results" : "https://imagizer.imageshack.com/img540/5931/0b3lg2.jpg",

    "adult_content" : False,
    "block_downloading": True,
    "bucket"        : 5931,
    "comments_count": 0,
    "comments_disabled": True,
    "copyright"     : "Ezekiel Gonzalez",
    "creation_date" : 1431013754,
    "date"          : "dt:2015-05-07 15:49:14",
    "description"   : "",
    "direct_link"   : "imagizer.imageshack.com/img540/5931/0b3lg2.jpg",
    "extension"     : "jpg",
    "featured"      : True,
    "filename"      : "DSC_6166-2",
    "filesize"      : 4406,
    "filter"        : 0,
    "height"        : 1987,
    "id"            : "f00b3lg2j",
    "is_owner"      : False,
    "liked"         : False,
    "likes"         : 0,
    "moderated"     : False,
    "next_images"   : [],
    "original_filename": "DSC_6166-2.jpg",
    "prev_images"   : [],
    "public"        : True,
    "server"        : 540,
    "tags"          : [],
    "title"         : "",
    "width"         : 3000,
    "owner"         : {
        "allow_following": False,
        "featured_photographer": True,
        "membership"     : "free",
        "username"       : "Ezekiel.Gonzalez",
    },
},

{
    "#url"     : "https://imageshack.com/user/Ezekiel.Gonzalez",
    "#class"   : imageshack.ImageshackUserExtractor,
    "#pattern" : r"https://imagizer\.imageshack\.com/img\d+/\d+/\w+\.jpg",
    "#count"   : 80,

    "adult_content": False,
    "bucket"       : int,
    "creation_date": range(1400000000, 1800000000),
    "date"         : "type:datetime",
    "direct_link"  : r"re:imagizer.imageshack.com/img\d+/\d+/\w+",
    "extension"    : {"jpg", "jpeg"},
    "filename"     : str,
    "filesize"     : int,
    "height"       : int,
    "hidden"       : False,
    "id"           : str,
    "is_owner"     : False,
    "liked"        : False,
    "likes"        : 0,
    "original_filename": str,
    "public"       : True,
    "server"       : int,
    "title"        : str,
    "total"        : 80,
    "width"        : int,
    "album"        : {
        "id"    : {"", "OGtz"},
        "public": bool,
        "title" : {"", "Iphone + VSCOCam"},
    },
    "owner"        : {
        "allow_following": False,
        "featured_photographer": True,
        "membership"     : "",
        "username"       : "Ezekiel.Gonzalez",
        "avatar"         : {
            "filename": "u6pApQ.jpg",
            "id"      : "p1u6pApQj",
        },
    },
},

{
    "#url"     : "https://imageshack.com/a/OGtz/1",
    "#class"   : imageshack.ImageshackGalleryExtractor,
    "#pattern" : r"https://imagizer\.imageshack\.com/img\d+/\d+/\w+\.jpg",
    "#count"   : 26,

    "width"  : int,
    "height" : int,
    "total"  : 26,
    "album"  : {
        "id"    : "OGtz",
        "public": True,
        "title" : "Iphone + VSCOCam",
    },
    "gallery": {
        "date"       : "dt:2014-11-25 17:21:00",
        "description": "",
        "id"         : "OGtz",
        "title"      : "Iphone + VSCOCam",
        "owner"      : {
            "allow_following": False,
            "membership"     : "free",
            "username"       : "Ezekiel.Gonzalez",
        },
    },
},

)
