Skip to content

Commit

Permalink
Pull from PrivacyDevel#50
Browse files Browse the repository at this point in the history
  • Loading branch information
taskylizard authored and qwerty01 committed Aug 10, 2024
1 parent 55d5c50 commit 167143e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/formatters.nim
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ proc proxifyVideo*(manifest: string; proxy: bool): string =
for line in manifest.splitLines:
let url =
if line.startsWith("#EXT-X-MAP:URI"): line[16 .. ^2]
elif line.startsWith("#EXT-X-MEDIA") and "URI=" in line:
line[line.find("URI=") + 5 .. -1 + line.find("\"", start= 5 + line.find("URI="))]
else: line
if url.startsWith('/'):
let path = "https://video.twimg.com" & url
Expand Down
3 changes: 1 addition & 2 deletions src/nitter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import types, config, prefs, formatters, redis_cache, http_pool, auth
import views/[general, about]
import routes/[
preferences, timeline, status, media, search, rss, list, debug,
twitter_api, unsupported, embed, resolver, router_utils]
unsupported, embed, resolver, router_utils]

const instancesUrl = "https://github.com/zedeus/nitter/wiki/Instances"
const issuesUrl = "https://github.com/zedeus/nitter/issues"
Expand Down Expand Up @@ -51,7 +51,6 @@ createSearchRouter(cfg)
createMediaRouter(cfg)
createEmbedRouter(cfg)
createRssRouter(cfg)
createTwitterApiRouter(cfg)
createDebugRouter(cfg)

settings:
Expand Down
3 changes: 2 additions & 1 deletion src/parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ proc parseGraphUser(js: JsonNode): User =
var user = js{"user_result", "result"}
if user.isNull:
user = ? js{"user_results", "result"}
result = parseUser(user{"legacy"}, user{"rest_id"}.getStr)

result = parseUser(user{"legacy"})

if result.verifiedType == VerifiedType.none and user{"is_blue_verified"}.getBool(false):
result.verifiedType = blue
Expand Down
4 changes: 3 additions & 1 deletion src/views/general.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ proc renderNavbar(cfg: Config; req: Request; rss, canonical: string): VNode =
if cfg.enableRss and rss.len > 0:
icon "rss-feed", title="RSS Feed", href=rss
icon "bird", title="Open in Twitter", href=canonical
a(href="https://liberapay.com/zedeus"): verbatim lp
icon "info", title="About", href="/about"
icon "cog", title="Preferences", href=("/settings?referer=" & encodeUrl(path))

proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
Expand Down Expand Up @@ -71,7 +73,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
link(rel="alternate", type="application/rss+xml", href=rss, title="RSS feed")

if prefs.hlsPlayback:
script(src="/js/hls.min.js", `defer`="")
script(src="/js/hls.light.min.js", `defer`="")
script(src="/js/hlsPlayback.js", `defer`="")

if prefs.infiniteScroll:
Expand Down
2 changes: 1 addition & 1 deletion src/views/profile.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ proc renderStat(num: int; class: string; text=""): VNode =
text insertSep($num, ',')

proc renderUserCard*(user: User; prefs: Prefs): VNode =
buildHtml(tdiv(class="profile-card", "data-profile-id" = $user.id)):
buildHtml(tdiv(class="profile-card")):
tdiv(class="profile-card-info"):
let
url = getPicUrl(user.getUserPic())
Expand Down

0 comments on commit 167143e

Please sign in to comment.