# -*- 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 foriio


__tests__ = (
{
    "#url"     : "https://www.foriio.com/works/2081544",
    "#comment" : "single image",
    "#class"   : foriio.ForiioWorkExtractor,
    "#results" : "https://foriio.imgix.net/store/d96eb4a34f7f69f1fb1e839abfc22cf6.jpg",

    "accept_collaboration": None,
    "author_id"      : 234603,
    "category_list"  : [],
    "count"          : 1,
    "created_by_user_id": "",
    "date"           : "dt:2025-12-14 05:13:15",
    "description"    : "沖縄県のシーサーとハンバーガーをコンセプトに制作したミニキャラクター",
    "extension"      : "jpg",
    "favorite_id"    : "",
    "file_id"        : 4165644,
    "filename"       : "d96eb4a34f7f69f1fb1e839abfc22cf6",
    "has_watermark"  : True,
    "height"         : 2048,
    "instagram_work" : False,
    "is_draft"       : False,
    "is_nsfw"        : False,
    "is_schedule"    : False,
    "notes_count"    : 0,
    "num"            : 1,
    "organization_id": "",
    "own_roles"      : ["デザイン"],
    "owner_id"       : 234603,
    "pinned_work"    : False,
    "published_at"   : "2025-12-14T05:13:15.506Z",
    "reject_collaboration": None,
    "schedule_time"  : None,
    "thumbnail"      : "https://foriio.imgix.net/store/d96eb4a34f7f69f1fb1e839abfc22cf6.jpg?ixlib=rb-4.1.1&auto=compress&w=688&h=424&fit=crop&mark=https%3A%2F%2Fdyci7co52mbcc.cloudfront.net%2Fpublic%2FSample-%25282%2529_225233.png&mark-alpha=20&mark-rot=30&mark-tile=grid&mark-pad=40&s=358509b4edd91392e233e69f188179cb",
    "thumbnail_id"   : None,
    "title"          : "オリジナルSDキャラクター",
    "type"           : "image",
    "width"          : 2048,
    "work_id"        : 2081544,
    "creative_roles" : list,
    "credits"        : list,
    "author"         : {
        "hidden_from_search_engines": False,
        "id"              : 234603,
        "is_pro"          : True,
        "screen_name"     : "konoha-inc",
        "status"          : "approved",
        "support_director": None,
        "profile"         : dict,
    },
},

{
    "#url"     : "https://www.foriio.com/works/16416",
    "#comment" : "image post, multiple '.psd' files",
    "#class"   : foriio.ForiioWorkExtractor,
    "#pattern" : r"https://foriio\.imgix\.net/store/\w+\.psd",
    "#count"   : 10,

    "accept_collaboration": None,
    "author_id"      : 9213,
    "category_list"  : [],
    "count"          : 10,
    "created_by_user_id": "",
    "date"           : "dt:2019-09-16 03:56:44",
    "description"    : "",
    "extension"      : "psd",
    "favorite_id"    : "",
    "file_id"        : int,
    "filename"       : "hash:md5",
    "has_watermark"  : False,
    "height"         : int,
    "instagram_work" : False,
    "is_draft"       : False,
    "is_nsfw"        : False,
    "is_schedule"    : None,
    "notes_count"    : 0,
    "num"            : range(1, 10),
    "organization_id": "",
    "own_roles"      : ["イラストレーター"],
    "owner_id"       : 9213,
    "pinned_work"    : False,
    "published_at"   : "2019-09-16T03:56:44.703Z",
    "reject_collaboration": None,
    "schedule_time"  : None,
    "thumbnail"      : "https://foriio.imgix.net/store/f355fa6a7da645954867ecf7b9bbcbd7.psd?ixlib=rb-4.1.0&auto=compress&w=688&h=424&rect=27%2C0%2C679%2C425&s=06b06c79f9c5d4159d4648e36ae98c78",
    "thumbnail_id"   : 42091,
    "title"          : "Illust:01",
    "type"           : "image",
    "width"          : int,
    "work_id"        : 16416,
},

{
    "#url"     : "https://www.foriio.com/works/2267154",
    "#comment" : "video post",
    "#class"   : foriio.ForiioWorkExtractor,
    "#results" : (
        "ytdl:https://www.youtube.com/watch?v=PX23Yq9fSWg",
        "ytdl:https://www.youtube.com/shorts/0zkhZ95h8F0",
    ),

    "author_id"   : 310691,
    "count"       : 2,
    "date"        : "dt:2026-03-16 17:48:22",
    "extension"   : "mp4",
    "file_id"     : {"PX23Yq9fSWg", "0zkhZ95h8F0"},
    "owner_id"    : 310691,
    "platform"    : {"youtube", "youtube_short"},
    "published_at": "2026-03-16T17:48:22.972Z",
    "thumbnail"   : "https://foriio.imgix.net/store/9XRWRG9dBrhZ_1773683652.jpg",
    "title"       : str,
    "type"        : "video",
    "video_id"    : {"PX23Yq9fSWg", "0zkhZ95h8F0"},
    "work_id"     : 2267154,
},

{
    "#url"     : "https://www.foriio.com/works/2267160",
    "#comment" : "webpage post",
    "#class"   : foriio.ForiioWorkExtractor,
    "#results" : "https://www.anisearch.de/",

    "date"   : "dt:2026-03-16 17:50:38",
    "domain" : "www.anisearch.de",
    "image"  : "https://foriio.imgix.net/store/DphWF_ZrthxW_1773683597.webp",
    "og_type": "website",
    "type"   : "web_article",
    "url"    : "https://www.anisearch.de/",
    "work_id": 2267160,
},

{
    "#url"     : "https://www.foriio.com/works/2267166",
    "#comment" : "audio post",
    "#class"   : foriio.ForiioWorkExtractor,
    "#results" : (
        "ytdl:http://soundcloud.com/ethmusic/lostin-powers-she-so-heavy",
        "ytdl:https://soundcloud.com/the80m/the-following",
    ),

    "count"    : 2,
    "date"     : "dt:2026-03-16 17:55:14",
    "extension": "mp3",
    "type"     : "sound",
    "work_id"  : 2267166,
    "metadata" : dict,
},

{
    "#url"     : "https://www.foriio.com/works/2267161",
    "#comment" : "copyright post",
    "#class"   : foriio.ForiioWorkExtractor,
    "#results" : "https://foriio.imgix.net/store/cw_image_YBe-KU5tfnEO_1773683697.png",

    "author_id"   : 310691,
    "date"        : "dt:2026-03-16 17:53:32",
    "file_id"     : 15246,
    "filename"    : "cw_image_YBe-KU5tfnEO_1773683697",
    "type"        : "copy_writing",
    "work_id"     : 2267161,
    "copy_writing": {
        "id"   : 15246,
        "image": "https://dyci7co52mbcc.cloudfront.net/store/cw_image_YBe-KU5tfnEO_1773683697.png",
        "title": "Copyright 2026 @gdldev",
    },
},

{
    "#url"     : "https://www.foriio.com/konoha-inc",
    "#class"   : foriio.ForiioUserExtractor,
    "#results" : (
        "https://foriio.com/works/1868200",
        "https://foriio.com/works/2050930",
        "https://foriio.com/works/1998734",
        "https://foriio.com/works/2093606",
        "https://foriio.com/works/1867751",
        "https://foriio.com/works/2081544",
    ),

    "author_id"      : {18138, 234603},
    "category_list"  : list,
    "has_watermark"  : bool,
    "id"             : int,
    "instagram_work" : False,
    "is_nsfw"        : False,
    "notes_count"    : 0,
    "organization_id": "",
    "owner_id"       : {18138, 234603},
    "pin_order"      : None,
    "pinned_work"    : False,
    "published_at"   : "iso:8601",
    "type"           : {"video", "image"},
},

{
    "#url"     : "https://www.foriio.com/konoha-inc",
    "#comment" : "'posts' option",
    "#class"   : foriio.ForiioUserExtractor,
    "#options" : {"posts": "image"},
    "#results" : "https://foriio.com/works/2081544",

    "author_id"      : 234603,
    "category_list"  : ["イラスト"],
    "has_watermark"  : True,
    "id"             : 2081544,
    "instagram_work" : False,
    "is_nsfw"        : False,
    "owner_id"       : 234603,
    "published_at"   : "2025-12-14T05:13:15.506Z",
    "thumbnail"      : "https://foriio.imgix.net/store/d96eb4a34f7f69f1fb1e839abfc22cf6.jpg?ixlib=rb-4.1.1&auto=compress&w=688&h=424&fit=crop&mark=https%3A%2F%2Fdyci7co52mbcc.cloudfront.net%2Fpublic%2FSample-%25282%2529_225233.png&mark-alpha=20&mark-rot=30&mark-tile=grid&mark-pad=40&s=358509b4edd91392e233e69f188179cb",
    "title"          : "オリジナルSDキャラクター",
    "type"           : "image",
    "user_roles"     : ["デザイン"],
},

)
