Merge branch 'zedeus:master' into master

This commit is contained in:
Salastil 2026-08-14 22:57:40 -04:00 committed by GitHub
commit 162a15f7a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 1552 additions and 178 deletions

View file

@ -34,7 +34,7 @@ proc initQuery*(pms: Table[string, string]; name=""): Query =
proc getMediaQuery*(name: string): Query =
Query(
kind: media,
kind: QueryKind.media,
filters: @["twimg", "native_video"],
fromUser: @[name],
sep: "OR"
@ -64,7 +64,7 @@ proc genQueryParam*(query: Query; maxId=""): string =
else:
param &= ")"
if query.fromUser.len > 0 and query.kind in {posts, media}:
if query.fromUser.len > 0 and query.kind in {posts, QueryKind.media}:
param &= " (filter:self_threads OR -filter:replies)"
if "nativeretweets" notin query.excludes:
@ -104,7 +104,9 @@ proc genQueryUrl*(query: Query): string =
if query.view.len > 0:
params.add "view=" & encodeUrl(query.view)
if query.kind in {tweets, users}:
# media doubles as the profile media tab, where f isn't part of the URL scheme
if query.kind in {tweets, users, lists, top} or
(query.kind == QueryKind.media and query.fromUser.len == 0):
params.add &"f={query.kind}"
if query.text.len > 0:
params.add "q=" & encodeUrl(query.text)