Author SHA1 Message Date
mycodedoesnotcompile2 7025eb1b43 Merge 13b3abbcab into 0cd9fd70cb 2025-12-13 13:12:32 +00:00
mycodedoesnotcompile2 13b3abbcab Rename postcss.config.ts to postcss.config.cjs 2025-12-13 13:12:29 +00:00
mycodedoesnotcompile2 b5784f609e Update medium_client.go 2025-12-13 12:45:06 +00:00
mycodedoesnotcompile2 e549b25e3a Update api.go 2025-12-13 12:44:03 +00:00
mycodedoesnotcompile2 b387a6d8f8 Update api.go 2025-12-13 12:43:46 +00:00
mycodedoesnotcompile2 9a6d287607 Update id_converter.go 2025-12-13 12:42:34 +00:00
mycodedoesnotcompile2 8b00007fb5 Update medium_client.go 2025-12-13 12:41:04 +00:00
mycodedoesnotcompile2 348e4e2527 Update medium_client.go 2025-12-13 12:39:16 +00:00
mycodedoesnotcompile2 d055ff6c72 Update medium_client.go 2025-12-13 12:31:48 +00:00
mycodedoesnotcompile2 6c9ba437a8 Update medium_client.go 2025-12-13 12:29:45 +00:00
mycodedoesnotcompile2 e50177599e Update medium_client.go 2025-12-13 12:29:15 +00:00
mycodedoesnotcompile2 d416ebad0f Update medium_client.go 2025-12-13 12:28:35 +00:00
mycodedoesnotcompile2 93f30a5a9a Update medium_client.go 2025-12-13 12:26:57 +00:00
mycodedoesnotcompile2 2965aeb592 Update medium_client.go 2025-12-13 12:26:05 +00:00
mycodedoesnotcompile2 f3beb86ec1 Update medium_client.go 2025-12-13 12:22:43 +00:00
mycodedoesnotcompile2 6c0f2a15c9 Update id_converter.go 2025-12-13 12:21:36 +00:00
mycodedoesnotcompile2 9bb6d7e79e Update medium_client.go 2025-12-13 12:21:27 +00:00
mycodedoesnotcompile2 36e5fe60e7 Update id_converter.go 2025-12-13 12:20:37 +00:00
mycodedoesnotcompile2 fd56a322f3 Update medium_client.go 2025-12-13 12:19:52 +00:00
mycodedoesnotcompile2 94a0f174d6 Update api.go 2025-12-13 12:05:50 +00:00
mycodedoesnotcompile2 49c695a291 Update id_converter.go 2025-12-13 12:05:19 +00:00
mycodedoesnotcompile2 39a72c9197 Update id_converter.go 2025-12-13 12:04:55 +00:00
mycodedoesnotcompile2 7d6e0c0aa8 Update api.go 2025-12-13 12:00:48 +00:00
mycodedoesnotcompile2 3e95bb581e Update api.go 2025-12-13 11:56:33 +00:00
mycodedoesnotcompile2 500eca390f Update api.go 2025-12-13 11:55:48 +00:00
mycodedoesnotcompile2 21bea85895 Update api.go 2025-12-13 11:53:17 +00:00
mycodedoesnotcompile2 4ae0b3c242 Update api.go 2025-12-13 11:50:04 +00:00
mycodedoesnotcompile2 c59e028ccd Update api.go 2025-12-13 11:46:40 +00:00
mycodedoesnotcompile2 2d48af0882 Update api.go 2025-12-13 11:46:09 +00:00
mycodedoesnotcompile2 3c9cda56d4 Update api.go 2025-12-13 11:45:38 +00:00
mycodedoesnotcompile2 0a4e286b24 Update api.go 2025-12-13 11:44:49 +00:00
mycodedoesnotcompile2 07949db7d5 Update api.go 2025-12-13 11:33:12 +00:00
mycodedoesnotcompile2 f2b44c6050 Update api.go 2025-12-13 11:32:28 +00:00
mycodedoesnotcompile2 e0e8a19963 Update api.go 2025-12-13 11:24:20 +00:00
mycodedoesnotcompile2 8f75e96acf Update api.go 2025-12-13 11:23:37 +00:00
mycodedoesnotcompile2 29b5f5fdcd Update api.go 2025-12-13 11:22:53 +00:00
mycodedoesnotcompile2 56458d4fdb Update api.go 2025-12-13 11:20:47 +00:00
mycodedoesnotcompile2 86823cb2e6 Update api.go 2025-12-13 11:12:49 +00:00
mycodedoesnotcompile2 3b4c17e744 Update api.go 2025-12-13 11:07:30 +00:00
mycodedoesnotcompile2 9607e4fd17 Update config.go 2025-12-13 11:01:19 +00:00
mycodedoesnotcompile2 20e2679dbd Update api.go 2025-06-03 18:15:57 +00:00
mycodedoesnotcompile2 b21a4c7e31 Update api.go 2025-06-03 18:15:27 +00:00
5 changed files with 83 additions and 262 deletions

No files matched your search

+8 -1
View File
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/http"
"sync"
"github.com/medium.rip/api/routes"
@@ -16,12 +17,14 @@ import (
)
func RegisterRoutes(ctx context.Context, wg *sync.WaitGroup, engine *html.Engine, fs http.FileSystem) {
// more Fiber options at https://docs.gofiber.io/api/fiber/
app := fiber.New(fiber.Config{
StreamRequestBody: true,
ServerHeader: "Katbox",
AppName: "Katbox",
DisableStartupMessage: true,
Views: engine,
Network: "tcp",
})
// static file server
@@ -30,6 +33,10 @@ func RegisterRoutes(ctx context.Context, wg *sync.WaitGroup, engine *html.Engine
Browse: config.Conf.Env == "dev",
}))
if config.Conf.Proxy != "" {
log.Printf("Using proxy: %s", config.Conf.Proxy)
}
routes.RegisterRoutes(app)
go func(app *fiber.App) {
@@ -48,4 +55,4 @@ func RegisterRoutes(ctx context.Context, wg *sync.WaitGroup, engine *html.Engine
log.Warn("Server shutdown Failed: ", err)
}
wg.Done()
}
}
+46 -257
View File
@@ -1,9 +1,5 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
devDependencies:
'@tailwindcss/typography':
specifier: ^0.5.9
@@ -13,7 +9,7 @@ devDependencies:
version: 20.2.5
autoprefixer:
specifier: ^10.4.14
version: 10.5.4(postcss@8.4.23)
version: 10.4.14(postcss@8.4.23)
postcss:
specifier: ^8.4.23
version: 8.4.23
@@ -22,7 +18,7 @@ devDependencies:
version: 3.3.2(ts-node@10.9.1)
ts-node:
specifier: ^10.9.1
version: 10.9.1(@types/node@20.2.5)(typescript@7.0.2)
version: 10.9.1(@types/node@20.2.5)(typescript@5.0.4)
vite:
specifier: ^4.3.9
version: 4.3.9(@types/node@20.2.5)
@@ -333,186 +329,6 @@ packages:
resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==}
dev: true
/@typescript/typescript-aix-ppc64@7.0.2:
resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [aix]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-darwin-arm64@7.0.2:
resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-darwin-x64@7.0.2:
resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-freebsd-arm64@7.0.2:
resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-freebsd-x64@7.0.2:
resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-arm64@7.0.2:
resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-arm@7.0.2:
resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==}
engines: {node: '>=16.20.0'}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-loong64@7.0.2:
resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==}
engines: {node: '>=16.20.0'}
cpu: [loong64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-mips64el@7.0.2:
resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==}
engines: {node: '>=16.20.0'}
cpu: [mips64el]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-ppc64@7.0.2:
resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-riscv64@7.0.2:
resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==}
engines: {node: '>=16.20.0'}
cpu: [riscv64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-s390x@7.0.2:
resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==}
engines: {node: '>=16.20.0'}
cpu: [s390x]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-x64@7.0.2:
resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-netbsd-arm64@7.0.2:
resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [netbsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-netbsd-x64@7.0.2:
resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [netbsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-openbsd-arm64@7.0.2:
resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [openbsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-openbsd-x64@7.0.2:
resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [openbsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-sunos-x64@7.0.2:
resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [sunos]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-win32-arm64@7.0.2:
resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-win32-x64@7.0.2:
resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/acorn-walk@8.2.0:
resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
engines: {node: '>=0.4.0'}
@@ -544,17 +360,18 @@ packages:
resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
dev: true
/autoprefixer@10.5.4(postcss@8.4.23):
resolution: {integrity: sha512-MaU0U/za7N3r6brxD4YB/l4NSrFzLPlANv6wEuQVaIPlD3L4W9rFcQPbL/EilY9BHhHvhfcz3gInDLrEtWT4EA==}
/autoprefixer@10.4.14(postcss@8.4.23):
resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==}
engines: {node: ^10 || ^12 || >=14}
hasBin: true
peerDependencies:
postcss: ^8.1.0
dependencies:
browserslist: 4.28.8
caniuse-lite: 1.0.30001809
fraction.js: 5.3.4
picocolors: 1.1.1
browserslist: 4.21.5
caniuse-lite: 1.0.30001489
fraction.js: 4.2.0
normalize-range: 0.1.2
picocolors: 1.0.0
postcss: 8.4.23
postcss-value-parser: 4.2.0
dev: true
@@ -563,12 +380,6 @@ packages:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
dev: true
/baseline-browser-mapping@2.11.14:
resolution: {integrity: sha512-JyJ954WzuIR8/FFzX0o5krdSTrBAkcCSRfWSleRsIHSWV+cZe2FI1PKggVkFke1hBldRs+LRxUczzE9iPmgZww==}
engines: {node: '>=6.0.0'}
hasBin: true
dev: true
/binary-extensions@2.2.0:
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
engines: {node: '>=8'}
@@ -588,16 +399,15 @@ packages:
fill-range: 7.0.1
dev: true
/browserslist@4.28.8:
resolution: {integrity: sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA==}
/browserslist@4.21.5:
resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
dependencies:
baseline-browser-mapping: 2.11.14
caniuse-lite: 1.0.30001809
electron-to-chromium: 1.5.406
node-releases: 2.0.53
update-browserslist-db: 1.3.1(browserslist@4.28.8)
caniuse-lite: 1.0.30001489
electron-to-chromium: 1.4.411
node-releases: 2.0.12
update-browserslist-db: 1.0.11(browserslist@4.21.5)
dev: true
/camelcase-css@2.0.1:
@@ -605,8 +415,8 @@ packages:
engines: {node: '>= 6'}
dev: true
/caniuse-lite@1.0.30001809:
resolution: {integrity: sha512-xxWVywk6a6Arlk+hymeycyn/VgqEfLDxupvhH/xiY5SJ/18kmi9o6MiO320DCUzypORHLtvh0I4i04tUhCNHNQ==}
/caniuse-lite@1.0.30001489:
resolution: {integrity: sha512-x1mgZEXK8jHIfAxm+xgdpHpk50IN3z3q3zP261/WS+uvePxW8izXuCu6AHz0lkuYTlATDehiZ/tNyYBdSQsOUQ==}
dev: true
/chokidar@3.5.3:
@@ -621,7 +431,7 @@ packages:
normalize-path: 3.0.0
readdirp: 3.6.0
optionalDependencies:
fsevents: 2.3.3
fsevents: 2.3.2
dev: true
/commander@4.1.1:
@@ -656,8 +466,8 @@ packages:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
dev: true
/electron-to-chromium@1.5.406:
resolution: {integrity: sha512-hWH5ORBi3d0IipnMh7BN5GDTaAmrSSSWmznwt2zltdiRNEWoEQyTwF0FFSBxzHO7hLSRT6loQu3IQGV0wg/Tvg==}
/electron-to-chromium@1.4.411:
resolution: {integrity: sha512-5VXLW4Qw89vM2WTICHua/y8v7fKGDRVa2VPOtBB9IpLvW316B+xd8yD1wTmLPY2ot/00P/qt87xdolj4aG/Lzg==}
dev: true
/esbuild@0.17.19:
@@ -690,8 +500,8 @@ packages:
'@esbuild/win32-x64': 0.17.19
dev: true
/escalade@3.2.0:
resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
/escalade@3.1.1:
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
engines: {node: '>=6'}
dev: true
@@ -719,16 +529,16 @@ packages:
to-regex-range: 5.0.1
dev: true
/fraction.js@5.3.4:
resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==}
/fraction.js@4.2.0:
resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==}
dev: true
/fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
dev: true
/fsevents@2.3.3:
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
/fsevents@2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
requiresBuild: true
@@ -875,9 +685,8 @@ packages:
hasBin: true
dev: true
/node-releases@2.0.53:
resolution: {integrity: sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ==}
engines: {node: '>=18'}
/node-releases@2.0.12:
resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==}
dev: true
/normalize-path@3.0.0:
@@ -885,6 +694,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/normalize-range@0.1.2:
resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==}
engines: {node: '>=0.10.0'}
dev: true
/object-assign@4.1.1:
resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
engines: {node: '>=0.10.0'}
@@ -914,10 +728,6 @@ packages:
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
dev: true
/picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
dev: true
/picomatch@2.3.1:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
@@ -969,7 +779,7 @@ packages:
dependencies:
lilconfig: 2.1.0
postcss: 8.4.23
ts-node: 10.9.1(@types/node@20.2.5)(typescript@7.0.2)
ts-node: 10.9.1(@types/node@20.2.5)(typescript@5.0.4)
yaml: 2.3.1
dev: true
@@ -1048,7 +858,7 @@ packages:
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
hasBin: true
optionalDependencies:
fsevents: 2.3.3
fsevents: 2.3.2
dev: true
/run-parallel@1.2.0:
@@ -1137,7 +947,7 @@ packages:
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
dev: true
/ts-node@10.9.1(@types/node@20.2.5)(typescript@7.0.2):
/ts-node@10.9.1(@types/node@20.2.5)(typescript@5.0.4):
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
hasBin: true
peerDependencies:
@@ -1163,47 +973,26 @@ packages:
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 7.0.2
typescript: 5.0.4
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
dev: true
/typescript@7.0.2:
resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==}
engines: {node: '>=16.20.0'}
/typescript@5.0.4:
resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==}
engines: {node: '>=12.20'}
hasBin: true
optionalDependencies:
'@typescript/typescript-aix-ppc64': 7.0.2
'@typescript/typescript-darwin-arm64': 7.0.2
'@typescript/typescript-darwin-x64': 7.0.2
'@typescript/typescript-freebsd-arm64': 7.0.2
'@typescript/typescript-freebsd-x64': 7.0.2
'@typescript/typescript-linux-arm': 7.0.2
'@typescript/typescript-linux-arm64': 7.0.2
'@typescript/typescript-linux-loong64': 7.0.2
'@typescript/typescript-linux-mips64el': 7.0.2
'@typescript/typescript-linux-ppc64': 7.0.2
'@typescript/typescript-linux-riscv64': 7.0.2
'@typescript/typescript-linux-s390x': 7.0.2
'@typescript/typescript-linux-x64': 7.0.2
'@typescript/typescript-netbsd-arm64': 7.0.2
'@typescript/typescript-netbsd-x64': 7.0.2
'@typescript/typescript-openbsd-arm64': 7.0.2
'@typescript/typescript-openbsd-x64': 7.0.2
'@typescript/typescript-sunos-x64': 7.0.2
'@typescript/typescript-win32-arm64': 7.0.2
'@typescript/typescript-win32-x64': 7.0.2
dev: true
/update-browserslist-db@1.3.1(browserslist@4.28.8):
resolution: {integrity: sha512-ZZ61DsRsOnakl74HAmp3oSN4aXUmEWXf+i/yv0h7tIBfICc3VdrFErQKUUKPgu3AMsTUMbcongALEN4l6GSUrQ==}
/update-browserslist-db@1.0.11(browserslist@4.21.5):
resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==}
hasBin: true
peerDependencies:
browserslist: '>= 4.21.0'
dependencies:
browserslist: 4.28.8
escalade: 3.2.0
picocolors: 1.1.1
browserslist: 4.21.5
escalade: 3.1.1
picocolors: 1.0.0
dev: true
/util-deprecate@1.0.2:
@@ -1244,7 +1033,7 @@ packages:
postcss: 8.4.23
rollup: 3.23.0
optionalDependencies:
fsevents: 2.3.3
fsevents: 2.3.2
dev: true
/wrappy@1.0.2:
File renamed without changes.
+1
View File
@@ -17,6 +17,7 @@ type Config struct {
S3Endpoint string `koanf:"S3_ENDPOINT"`
Env string `koanf:"ENV"`
SecretKey string `koanf:"SECRET_KEY"`
Proxy string `koanf:"PROXY"`
}
var Conf *Config
+28 -4
View File
@@ -6,6 +6,8 @@ import (
"net/http"
"os"
"strings"
"net/url"
"crypto/tls"
log "github.com/sirupsen/logrus"
@@ -30,13 +32,35 @@ func PostData(postId string) (*entities.MediumResponse, error) {
}
// http client to post data
url := "https://medium.com/_/graphql"
urlreq := "https://medium.com/_/graphql"
method := "POST"
payload := strings.NewReader(fmt.Sprintf("{\"query\":\"query {\\n post(id: \\\"%s\\\") {\\n title\\n createdAt\\n creator {\\n id\\n name\\n }\\n content {\\n bodyModel {\\n paragraphs {\\n name\\n text\\n type\\n href\\n layout\\n markups {\\n title\\n type\\n href\\n userId\\n start\\n end\\n anchorType\\n }\\n iframe {\\n mediaResource {\\n href\\n iframeSrc\\n iframeWidth\\n iframeHeight\\n }\\n }\\n metadata {\\n id\\n originalWidth\\n originalHeight\\n }\\n }\\n }\\n }\\n }\\n }\",\"variables\":{}}", postId))
client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
//log.Printf("Article ID: %s", postId)
//log.Printf("PAYLOAD: %s", payload)
var client *http.Client
if config.Conf.Proxy != "" {
proxyURL, err := url.Parse(config.Conf.Proxy)
if err != nil {
panic(err)
}
client = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(proxyURL),
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
},
}
} else {
client = &http.Client{}
}
req, err := http.NewRequest(method, urlreq, payload)
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36")
if err != nil {
log.Printf("Error constructing request %v\n", err)
return nil, err