Feature: Get size by api for ptp btn and ggn (#66)

* chore: add package

* feat: get size by api for ptp and btn

* feat: download and parse torrent if not api

* feat: bypass tls check and load meta from file

* fix: no invite command needed for btn

* feat: add ggn api

* feat: imrpove logging

* feat: build request url

* feat: improve err logging
This commit is contained in:
Ludvig Lundgren 2022-01-05 23:52:29 +01:00 committed by GitHub
parent d2aa7c1e7e
commit 2ea2293745
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 2181 additions and 99 deletions

8
pkg/btn/testdata/btn_bad_creds.json vendored Normal file
View file

@ -0,0 +1,8 @@
{
"id": 1,
"result": null,
"error": {
"code": -32001,
"message": "Invalid API Key"
}
}

View file

@ -0,0 +1,30 @@
{
"id": 1,
"result": {
"GroupName": "S05E04",
"GroupID": "755034",
"TorrentID": "1555073",
"SeriesID": "70834",
"Series": "That Show",
"SeriesBanner": "\/\/cdn2.broadcasthe.net\/tvdb\/banners\/graphical\/0000000000000.jpg",
"SeriesPoster": "\/\/cdn2.broadcasthe.net\/tvdb\/banners\/posters\/0000000000000\/resized_w300.jpg",
"YoutubeTrailer": "",
"Category": "Episode",
"Snatched": "4",
"Seeders": "5",
"Leechers": "41",
"Source": "WEB-DL",
"Container": "MP4",
"Codec": "H.264",
"Resolution": "1080p",
"Origin": "None",
"ReleaseName": "That.Show.S05E04.1080p.WEB-DL.H.264-NOGRP",
"Size": "3288852849",
"Time": "1641153886",
"TvdbID": "332747",
"TvrageID": "0",
"ImdbID": "7252812",
"InfoHash": "56CD94119F6BF7FC294A92D7A4099C3D1815C907",
"DownloadURL": "https:\/\/broadcasthe.net\/torrents.php?action=download&id=1555073&authkey=REDACTED&torrent_pass=REDACTED"
}
}

22
pkg/btn/testdata/btn_get_user_info.json vendored Normal file
View file

@ -0,0 +1,22 @@
{
"id": 1,
"result": {
"UserID": "0000000",
"Username": "username",
"Email": "email@example.com",
"Upload": "90000000000004",
"Download": "10000000000002",
"Lumens": "10000",
"Bonus": "1000000000",
"JoinDate": "1578088136",
"Title": "",
"Enabled": "1",
"Paranoia": "1",
"Invites": "0",
"Class": "Elite",
"ClassLevel": "301",
"HnR": "0",
"UploadsSnatched": "100",
"Snatches": "100"
}
}