Commit Graph

104 Commits

Author SHA1 Message Date
BishopRed
b11434a069 [kemonoparty] Support /posts endpoint and Creator Tag Calls
- Adding support for calling a creator with a tag selected.
    It is using a legacy endpoint but there is no other way currently
    documented to get the users post filtered by a tag.
- Fixing the User Tags feature to be paginated
    offset is not defined in the API but it is supported.
- Fixed the `/posts` endpoint not working:
    1. Added check along with metadata to make sure there is a
       creator/service information as that is a requirement
    2. Fixed the parameter from tags -> tag.
    3. Fixed the _paginate call to exit correctly when there is
       a key required for the data (it was prematurely exiting)
- Adding a type of caching mechanism for the metadata/user information.
    The current logic would work just fine if looking up for a
    singular user, however for the multiple posts via normal
    filtering would cause it to either:
    This builds a local cache during the process so it should
    only make a call for the user info once during the process.
- Updating to meet standards
    Fixes
      1. Reset formatting for unnecessary line changes
      2. Removed Type Hinting
      3.Replaced f-string with "".format
   Updates
     Renamed function creator_posts_tags -> creator_tagged_posts
     for clarity of what it does (get posts tags vs get tagged posts)
- Fixing check for the length of response:
    1. If it is list - just check len
    2. If there is a key - check that the key length is less
       than the batch.
- add test for '?tag=...' user URLs
    plus some code simplifications
2025-01-21 19:20:22 +01:00
Mike Fährmann
081856b9ce [kemonoparty] handle 'discord' favorites (#6706) 2024-12-22 18:56:21 +01:00
Mike Fährmann
b6b1008ef2 [kemonoparty] support new favorite URLs (#6676) 2024-12-16 07:45:33 +01:00
Mike Fährmann
f33ca82ce7 [kemonoparty] fix 'o' query parameter handling (#6597)
fixes regression introduced in 74d855c6
2024-12-04 18:26:38 +01:00
Mike Fährmann
7c7b8a25c3 [kemonoparty] fix login / update favorites extractor (#6415) 2024-11-28 14:41:16 +01:00
Mike Fährmann
e1aa4a7162 [kemonoparty] support new discord channel URLs (#6542) 2024-11-27 15:19:27 +01:00
Mike Fährmann
2162fa7df2 [kemonoparty] fix 'comments' for posts without comments (#6415)
https://github.com/mikf/gallery-dl/issues/6415#issuecomment-2501966303
2024-11-26 23:23:39 +01:00
Mike Fährmann
74d855c693 [kemonoparty] update to new site layout / API endpoints
(#6415, #6503, #6528, #6530, #6536)

… at least for the most part. Favorites are still broken, but the rest
should be functional again.
2024-11-26 22:15:28 +01:00
Mike Fährmann
2cab87c5b6 [kemonoparty:favorite] fix exception when sorting None (#5692) 2024-06-05 16:49:30 +02:00
Mike Fährmann
86a97d8e27 [kemonoparty] fix crash on posts with missing datetime info (#5422) 2024-04-05 00:25:23 +02:00
Mike Fährmann
9cce461627 [kemonoparty] add 'announcements' option (#5262)
https://github.com/mikf/gallery-dl/issues/5262#issuecomment-2015919188
2024-03-26 15:20:14 +01:00
Mike Fährmann
72ac2c750d [kemonoparty:favorite] support 'sort' and 'order' query params (#5375) 2024-03-26 02:27:36 +01:00
Mike Fährmann
15a4bc2584 [kemonoparty] fix KeyError for empty files (#5368) 2024-03-24 02:21:38 +01:00
Mike Fährmann
fe9171508f [kemonoparty] fix exception for '/revision/' URLs
caused by 03a9ce98
2024-03-22 03:10:12 +01:00
Mike Fährmann
03a9ce9832 [kemonoparty] add 'order-revisions' option (#5334) 2024-03-15 23:06:05 +01:00
Mike Fährmann
1418c0ce38 [kemonoparty] add 'revision_count' metadata field (#5334) 2024-03-15 22:28:15 +01:00
Mike Fährmann
fde9e25c9f [tests:kemonoparty] '.party' -> '.su' 2024-02-26 22:25:04 +01:00
Mike Fährmann
139ff3f6ab [kemonoparty] add 'posts' extractor (#5194) 2024-02-13 15:41:34 +01:00
Mike Fährmann
afd20ef42c [kemonoparty] implement filtering duplicate revisions (#5013)
set 'revisions' to '"unique"' to have it ignore duplicate revisions
2024-01-26 14:44:15 +01:00
Mike Fährmann
c28475d325 [kemonoparty] fix deleting 'name' in orginal objects (#5103)
... when computing 'revision_hash'

regression caused by 3d68eda4

dict.copy() only creates a shallow copy
I know that and still managed to get I wrong ...
2024-01-25 23:46:19 +01:00
Mike Fährmann
3d68eda4ab [kemonoparty] add 'revision_hash' metadata (#4706, #4727, #5013)
A SHA1 hexdigest of other relevant metadata fields like
title, content, file and attachment URLs.

This value does NOT reflect which revisions are listed on the website.
Neither does 'edited' or any other metadata field (combinations).
2024-01-16 00:38:10 +01:00
Mike Fährmann
57fc6fcf83 replace '24*3600' with '86400'
and generalize cache maxage values
2023-12-18 23:57:22 +01:00
Mike Fährmann
caf31e751c [kemonoparty] limit 'title' length (#4741) 2023-11-02 15:53:23 +01:00
Mike Fährmann
d0effcae20 [kemonoparty] add 'revision_index' metadata field (#4727) 2023-10-26 22:26:38 +02:00
Mike Fährmann
3bbaa875f1 [kemonoparty] fix parsing of non-standard 'dates' (#4676) 2023-10-26 21:50:18 +02:00
Mike Fährmann
0d52b775cb [kemonoparty] add 'revisions' option (#4498, #4597) 2023-10-20 15:20:49 +02:00
Mike Fährmann
6e830ffc9e [kemonoparty] support post searches (#3385, #4057) 2023-10-19 23:06:06 +02:00
Mike Fährmann
aaf539009b [kemonoparty] initial support for post revisions (#4498, #4597)
- single revision
https://kemono.party/SERVICE/user/12345/post/12345/revision/12345

- all revisions
https://kemono.party/SERVICE/user/12345/post/12345/revisions
2023-10-19 22:32:51 +02:00
Mike Fährmann
174191cb79 [kemonoparty] restore discord pagination (#4676) 2023-10-19 21:57:27 +02:00
Mike Fährmann
c9a976d8a6 [kemonoparty] various updates and fixes (#4676, #4681)
- fix pagination
- fix 'date' metadata
- fix discord channel API endpoint
2023-10-19 17:36:16 +02:00
Klion Xu
dc1c2139b1 fix line too long 2023-10-19 10:54:08 +08:00
Klion Xu
6b22af9720 [kemonoparty] update API endpoint (#4676) 2023-10-19 10:32:59 +08:00
Mike Fährmann
ade8347ead [kemonoparty] fix DM dates 2023-10-15 19:54:28 +02:00
Mike Fährmann
6dfe200ae4 [kemonoparty] support discord URLs with channel IDs (#4662) 2023-10-15 19:45:22 +02:00
Mike Fährmann
3ecb512722 send Referer headers by default 2023-09-19 00:02:04 +02:00
Mike Fährmann
d13c82eff1 [kemonoparty] update favorites API endpoint (#4522) 2023-09-14 14:57:01 +02:00
Mike Fährmann
27ec653991 fix bug in test_init and update example URLs 2023-09-14 13:27:03 +02:00
Mike Fährmann
a453335a9f remove test results in extractor modules
and add generic example URLs
2023-09-11 16:30:55 +02:00
Mike Fährmann
a383eca7f6 decouple extractor initialization
Introduce an 'initialize()' function that does the actual init
(session, cookies, config options) and can called separately from
the constructor __init__().

This allows, for example, to adjust config access inside a Job
before most of it already happened when calling 'extractor.find()'.
2023-07-25 22:16:16 +02:00
Mike Fährmann
d97b8c2fba consistent cookie-related names
- rename every cookie variable or method to 'cookies_*'
- simplify '.session.cookies' to just '.cookies'
- more consistent 'login()' structure
2023-07-22 01:20:50 +02:00
Mike Fährmann
4ae925c88f [kemonoparty] support '.su' TLD (#4139) 2023-06-06 20:55:03 +02:00
Mike Fährmann
3516fdae74 [kemonoparty] fix kemono and coomer logins using the same cache
(#4098)
2023-05-26 13:35:02 +02:00
Mike Fährmann
76b01b64cf [kemonoparty] remove MD5 hash extraction (#3531)
This partially reverts commit 20d6194ffa.
2023-01-25 11:10:09 +01:00
ClosedPort22
20d6194ffa [kemonoparty] improve hash extraction
- extract MD5 hash from URLs
- extract MD5 and SHA256 hash from Discord URLs (kemono.party only)
- minor optimization (do not call 'hashes.add' when 'duplicates' is
  true)
- update tests accordingly

Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
2023-01-15 12:01:13 +08:00
Mike Fährmann
85bd1cbc89 [kemonoparty] fix regression from 473bd380 (#3519)
- do not access 'response.content' unless necessary
- only validate responses if filename extensions differ
2023-01-11 15:25:01 +01:00
Mike Fährmann
473bd380c8 [kemonoparty] reject invalid/empty files (#3510) 2023-01-10 19:04:47 +01:00
Mike Fährmann
b0cb4a1b9c replace 'text.extract()' with 'text.extr()' where possible 2022-11-05 01:14:09 +01:00
Mike Fährmann
77173694d5 [kemonoparty] fix 'dms' extraction (#3106) 2022-10-26 14:25:43 +02:00
Mike Fährmann
94a2dfe205 [kemonoparty] update pagination offset 2022-10-17 10:22:12 +02:00
Mike Fährmann
78694a61bb [kemonoparty] restore 'favorites' API endpoints (#2994) 2022-10-01 12:15:32 +02:00