From 21eaf4d81f039bf31c233867775bcd6ec91da527 Mon Sep 17 00:00:00 2001 From: zlotowek Date: Sun, 4 Oct 2026 16:16:57 +0200 Subject: [PATCH] feat: add support for gitea session tokens --- scrape_kpgpmc.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scrape_kpgpmc.swift b/scrape_kpgpmc.swift index 05ca82c..6686cb8 100644 --- a/scrape_kpgpmc.swift +++ b/scrape_kpgpmc.swift @@ -4,6 +4,12 @@ import Foundation let gitea = URL(string: "https://git.kpgpmc.org/explore/repos")! var request = URLRequest(url: gitea) request.httpMethod = "GET" + +if CommandLine.arguments.count > 1, + let cookiestring = String?(CommandLine.arguments[1]) { + request.setValue("i_like_gitea=\(cookiestring)", forHTTPHeaderField: "Cookie") +} + let semaphore = DispatchSemaphore(value: 0) let search_string = "tw-text-primary name" let hrefRegex = #/href="([^"]+)"/#