Uploading API

SnowtiqPosted at 2018-04-10 14:19:56(311Wks ago) Report Permalink URL 
Reppoints: 835
Posts: 5
Uploads: 0

Usage of upload API is available only to Verified & Trusted uploaders.
Request/reset API key can be done in account settings.

specification
POST https://torrentgalaxy.to/uploadapi.php
parameters
Required
  • apikey - Your personal API key
  • category - (int) torrent category
  • torrent - .torrent file
    Optional
  • name - torrent name (Name will be taken from torrentfile otherwise)
  • coverpic - coverpicture file
  • descr - torrent description
  • lang - (int) torrent language  (English otherwise)
       (parameters below only have effect in categories Movies, TV & Documentaries)
  • imdb - IMDB link or ID (https://www.imdb.com/title/tt1365519 or tt1365519)
  • imdblookup - (int) 0 to disable auto IMDB lookup when no imdb link/id is given (enabled by default)

    JSON response
    example
    {"status":"Success","feedback":"Torrent uploaded","torrentid":46}

    Last edited by miok on 2021-07-20 15:41:28


  •  
    Post liked by - XannyFamily:_verified_uploader::_junkie::_turtle:, ExGamer:_moderator:, MadWatchdog:_moderator:, brightshadow:_trusted_user::_male::_junkie::_sun::_turtle:, zeke23:_vip::_trusted_user::_sitefriend::_male::_sitelover::_sun:, Prom3th3uS:_male::_sitelover::_junkie::_kitty::_sun::_turtle:, Mazemaze16:_trusted_user::_male:, mercs213:_male::_junkie:, Ange1:_vip::_trusted_user::_sitefriend::_female::_sitelover::_sun:
    oldskoolplaya:_trusted_user::_male:Posted at 2018-05-24 22:42:42(304Wks ago) Report Permalink URL 
    Reppoints: 5
    Posts: 2
    Uploads: 1

    Ok it's known that i am a noob (and proud) but what is an api

     
    Post liked by - LRS:_vip::_trusted_user::_sitefriend:
    zeke23:_vip::_trusted_user::_sitefriend::_male::_sitelover::_sun:Posted at 2018-05-24 23:02:54(304Wks ago) Report Permalink URL 
    Reppoints: 1385
    Posts: 1968
    Uploads: 1449

    oldskoolplaya wrote:

    Ok it's known that i am a noob (and proud) but what is an api
    read the header and learn mate:)

     
    LRS:_vip::_trusted_user::_sitefriend:Posted at 2018-05-24 23:05:22(304Wks ago) Report Permalink URL 
    Reppoints: 880
    Posts: 1311
    Uploads: 0

    The use of a script to upload files to your account so it's automated, mainly for those who upload to many sites doing it manually can be timely especially when you want to be 1st to release a given torrent

     
    Post liked by - moviesbazar89:_blocked:, Prom3th3uS:_male::_sitelover::_junkie::_kitty::_sun::_turtle:
    zeke23:_vip::_trusted_user::_sitefriend::_male::_sitelover::_sun:Posted at 2018-06-07 14:11:04(303Wks ago) Report Permalink URL 
    Reppoints: 1385
    Posts: 1968
    Uploads: 1449

    anyone looking for this

     
    MafiaSSS:_trusted_user::_sitefriend::_male::_junkie:Posted at 2018-06-07 16:13:58(303Wks ago) Report Permalink URL 
    Reppoints: 75
    Posts: 7
    Uploads: 244

    video tutorial will be a good idea to explain the working of api who can't get it to work.

     
    zeke23:_vip::_trusted_user::_sitefriend::_male::_sitelover::_sun:Posted at 2018-10-17 12:11:26(284Wks ago) Report Permalink URL 
    Reppoints: 1385
    Posts: 1968
    Uploads: 1449

    one more way we help uploaders on TGx:)

     
    apkshadow:_trusted_uploader::_sitefriend::_male::_sitelover::_junkie::_kitty:Posted at 2018-10-28 09:01:40(282Wks ago) Report Permalink URL 
    Reppoints: 50
    Posts: 9
    Uploads: 3139

    i got the api key now how to use this ? any video tutorial ?
    ang guide? pleasE?

     
    zeke23:_vip::_trusted_user::_sitefriend::_male::_sitelover::_sun:Posted at 2018-10-28 13:35:17(282Wks ago) Report Permalink URL 
    Reppoints: 1385
    Posts: 1968
    Uploads: 1449

    you must be VUL or Trusted to use this

     
    Post liked by - Prom3th3uS:_male::_sitelover::_junkie::_kitty::_sun::_turtle:
    battlestar:_trusted_uploader::_sitefriend::_male::_sitelover::_junkie:Posted at 2018-11-02 02:53:31(281Wks ago) Report Permalink URL 
    Reppoints: 847
    Posts: 1705
    Uploads: 6586

    zeke23 wrote:

    anyone looking for this
    Yes, and it seems to be working just fine.

    (aside from one question, posted elsewhere).

     
    Post liked by - zeke23:_vip::_trusted_user::_sitefriend::_male::_sitelover::_sun:
    zeke23:_vip::_trusted_user::_sitefriend::_male::_sitelover::_sun:Posted at 2019-01-02 15:57:51(273Wks ago) Report Permalink URL 
    Reppoints: 1385
    Posts: 1968
    Uploads: 1449

    battlestar wrote:

    zeke23 wrote:

    anyone looking for this
    Yes, and it seems to be working just fine.

    (aside from one question, posted elsewhere).
    VUL and up may use it enjoy:)

     
    TJ101:_trusted_uploader::_junkie:Posted at 2020-04-05 12:20:21(207Wks ago) Report Permalink URL 
    Reppoints: 15
    Posts: 12
    Uploads: 864

    I wanna use this api, how long do i have to wait in order to be a verified uploader?

     
    miok:_admin:Posted at 2020-04-05 13:12:28(207Wks ago) Report Permalink URL 
    Master Lurker
    Reppoints: 5770
    Posts: 9173
    Uploads: 3449

    TJ101 wrote:

    I wanna use this api, how long do i have to wait in order to be a verified uploader?
    Verified Uploader status cannot be applied for. It is awarded at the discretion of staff and admin.
    Many factors are involved in the decision, such as your adherence to all uploading rules, the quality of your content and torrent descriptions, the regularity of your uploads and your ability to keep your torrents seeded. It usually takes a month or sometimes longer to become verified.

    Last edited by miok on 2020-04-05 13:17:11


     
    Post liked by - shameless:_trusted_user:, Prom3th3uS:_male::_sitelover::_junkie::_kitty::_sun::_turtle:, Deep61:_moderator:
    moviesbazar89:_blocked:Posted at 2021-06-17 13:17:44(145Wks ago) Report Permalink URL 
    Reppoints: 5
    Posts: 5
    Uploads: 304

    Looking Forward to have my own API Key, :_B)

     
    F1Carreras:_trusted_uploader::_male:Posted at 2023-07-12 18:37:31(37Wks ago) Report Permalink URL 
    Reppoints: 23
    Posts: 17
    Uploads: 144

    Hi, I'm performing some testing to use APIKEY. I created below bash script to upload a "Test" torrent file in Sports category. I get this error:

    Upload API response:
    {"status":"Failed","feedback":"Missing data","torrentid":0}


    Could someone pointme where the problem is in my code? Thanks.

    Quote:

    #!/bin/bash

    API_KEY="XXXXXXXXXXX"
    TORRENT_FILE="/path/to/torrent/test.torrent"
    DESCRIPTION_FILE="/path/to/description.txt"
    CATEGORY_ID=7

    # Base URL for the TorrentGalaxy API
    API_URL="https://torrentgalaxy.to/uploadapi.php"

    # Extract name from torrent file
    NAME=$(basename "${TORRENT_FILE%.*}")

    # Read description from file
    DESCRIPTION=$(cat "${DESCRIPTION_FILE}")

    # Step 1: Get upload token
    token_response=$(curl -s -X POST -d "apikey=${API_KEY}" "${API_URL}")
    token=$(echo "${token_response}" | jq -r '.token')

    # Step 2: Upload torrent file
    upload_response=$(curl -s -X POST -F "token=${token}" -F "file=@${TORRENT_FILE}" -F "category=${CATEGORY_ID}" -F "name=${NAME}" -F "description=${DESCRIPTION}" "${API_URL}")
    upload_status=$(echo "${upload_response}" | jq -r '.status')
    upload_message=$(echo "${upload_response}" | jq -r '.message')

    # Print full API response for debugging
    echo "Upload API response:"
    echo "${upload_response}"

    if [[ "${upload_status}" == "success" ]]; then
     echo "Torrent uploaded successfully!"
     echo "Message: ${upload_message}"
    else
     echo "Torrent upload failed."
     echo "Error message: ${upload_message}"
    fi


     
    battlestar:_trusted_uploader::_sitefriend::_male::_sitelover::_junkie:Posted at 2023-07-12 23:25:51(37Wks ago) Report Permalink URL 
    Reppoints: 847
    Posts: 1705
    Uploads: 6586

    Where did you get that code from ?

     
    Post liked by - miok:_admin:, MadWatchdog:_moderator:
    F1Carreras:_trusted_uploader::_male:Posted at 2023-07-13 04:49:26(37Wks ago) Report Permalink URL 
    Reppoints: 23
    Posts: 17
    Uploads: 144

    battlestar wrote:

    Where did you get that code from ?
    ChatGPT.

    If someone is able to share a Bash or Python script code sample it would be great.

     
    Post liked by - miok:_admin:
    Barharmar:_trusted_user::_male::_sitelover::_junkie::_kitty::_sun::_turtle:Posted at 2023-07-13 10:29:58(37Wks ago) Report Permalink URL 
    Reppoints: 660
    Posts: 1034
    Uploads: 0

    F1Carreras wrote:

    battlestar wrote:

    Where did you get that code from ?
    ChatGPT.

    If someone is able to share a Bash or Python script code sample it would be great.
    I think the problem is in the two "jq" expressions in step two

     
    F1Carreras:_trusted_uploader::_male:Posted at 2023-07-14 17:14:07(36Wks ago) Report Permalink URL 
    Reppoints: 23
    Posts: 17
    Uploads: 144

    Barharmar wrote:

    F1Carreras wrote:

    battlestar wrote:

    Where did you get that code from ?
    ChatGPT.

    If someone is able to share a Bash or Python script code sample it would be great.
    I think the problem is in the two "jq" expressions in step two
    I'm geting error:  "Token: Failed" ... I'm using APIKEY provided under 'settings' in my profile and also this API_URL = https://torrentgalaxy.to/uploadapi.php

    Is there anything wrong?

    Image error

     
    battlestar:_trusted_uploader::_sitefriend::_male::_sitelover::_junkie:Posted at 2023-07-14 21:20:50(36Wks ago) Report Permalink URL 
    Reppoints: 847
    Posts: 1705
    Uploads: 6586

    F1Carreras wrote:

    ChatGPT.
    :_facepalm


    There is no such thing as an upload token.
    Its failing because you're not providing the API Key in the actual upload.
    Get rid of step 1, it does nothing. In step 2, replace the token with the apikey.

     
    Post liked by - Mafketel:_super_admin::_male:, EVILTEEN777:_trusted_user::_male::_sitelover::_junkie::_kitty::_sun::_turtle:, miok:_admin:, Barharmar:_trusted_user::_male::_sitelover::_junkie::_kitty::_sun::_turtle:
    F1Carreras:_trusted_uploader::_male:Posted at 2023-07-17 21:53:09(36Wks ago) Report Permalink URL 
    Reppoints: 23
    Posts: 17
    Uploads: 144

    battlestar wrote:

    F1Carreras wrote:

    ChatGPT.
    :_facepalm


    There is no such thing as an upload token.
    Its failing because you're not providing the API Key in the actual upload.
    Get rid of step 1, it does nothing. In step 2, replace the token with the apikey.
    Now I'm using this updated bash script -->

    Quote:

    GNU nano 5.4                                                                                torrentgalaxy.sh
    #!/bin/bash

    API_KEY="XXXXXXXXX"
    TORRENT="/home/f1carreras/downloads/f1/test.torrent"
    DESCRIPTION_FILE="/home/f1carreras/downloads/f1/description.txt"
    CATEGORY="7"

    # Base URL for the TorrentGalaxy API
    API_URL="https://torrentgalaxy.to/uploadapi.php"

    # Extract name from torrent file
    NAME=$(basename "${TORRENT%.*}")

    # Read description from file
    DESCRIPTION=$(cat "${DESCRIPTION_FILE}")

    echo "Uploading Torrent to TorrentGalaxy..."
    echo "Torrent File: ${TORRENT}"
    echo "Description File: ${DESCRIPTION_FILE}"
    echo "Torrent Name: ${NAME}"
    echo "Category: ${CATEGORY}"
    echo "API Key: ${API_KEY}"

    # Step: Upload torrent file
    echo "Uploading torrent file..."
    upload_response=$(curl -s -F "API_KEY=${API_KEY}" -F "file=@${TORRENT}" -F "category=${CATEGORY}" -F "name=${NAME}" -F "description=${DESCRIPTION}" "${API_URL}")
    upload_status=$(echo "${upload_response}" | awk -F'"' '{print $4}')
    upload_message=$(echo "${upload_response}" | awk -F'"' '{print $8}')
    echo "Upload API response:"
    echo "${upload_response}"

    if [[ "${upload_status}" == "success" ]]; then
     echo "Torrent uploaded successfully!"
     echo "Message: ${upload_message}"
    else
     echo "Torrent upload failed."
     echo "Error message: ${upload_message}"
    fi
    I'm still getting error: {"status":"Failed","feedback":"Missing data","torrentid":0}

    Could you please provide more guidance on my code? Thanks.

     
    battlestar:_trusted_uploader::_sitefriend::_male::_sitelover::_junkie:Posted at 2023-07-19 01:37:51(36Wks ago) Report Permalink URL 
    Reppoints: 847
    Posts: 1705
    Uploads: 6586

    You already know what that error means, as I told you in the last reply.

    Read the first post again, and make sure your field names [in the upload step] match what it states.



    ( hint ... they dont atm, hence the failure ).

    .

    Last edited by battlestar on 2023-07-19 01:38:18


     
    Post liked by - miok:_admin:
    F1Carreras:_trusted_uploader::_male:Posted at 2023-07-19 20:35:59(36Wks ago) Report Permalink URL 
    Reppoints: 23
    Posts: 17
    Uploads: 144

    I have tried now the following script, as you can notice in "upload" section I have field names as stated in first post. I'm not sure what's wrong. I'm getting crazy now =S ... Please provide another hint. I really need to automate my uploads.

    Quote:

    #!/bin/bash

    apikey="XXXXXXXXX"
    torrent="/home/f1carreras/downloads/f1/test.torrent"
    descr="/home/f1carreras/downloads/f1/description.txt"
    category="7"

    # Base URL for the TorrentGalaxy API
    API_URL="https://torrentgalaxy.to/uploadapi.php"

    # Extract name from torrent file
    name=$(basename "${torrent%.*}")

    # Read description from file
    descr=$(cat "${descr}")

    # Upload torrent file
    echo "Uploading torrent file..."
    upload_response=$(curl -s -F "apikey=${apikey}" -F "torrent=@${torrent}" -F "category=${category}" -F "name=${name}" -F "descr=${descr}" "${API_URL}")
    upload_status=$(echo "${upload_response}" | awk -F'"' '{print $4}')
    upload_message=$(echo "${upload_response}" | awk -F'"' '{print $8}')
    echo "Upload API response:"
    echo "${upload_response}"

    if [[ "${upload_status}" == "success" ]]; then
     echo "Torrent uploaded successfully!"
     echo "Message: ${upload_message}"
    else
     echo "Torrent upload failed."
     echo "Error message: ${upload_message}"
    fi


     
    F1Carreras:_trusted_uploader::_male:Posted at 2023-07-19 20:39:26(36Wks ago) Report Permalink URL 
    Reppoints: 23
    Posts: 17
    Uploads: 144

    I forgot to add API response. See below:

    Image error

     
    F1Carreras:_trusted_uploader::_male:Posted at 2023-07-19 20:49:28(36Wks ago) Report Permalink URL 
    Reppoints: 23
    Posts: 17
    Uploads: 144

    I finally have it working!!! :_B)

    Image error

     
    Post liked by - Barharmar:_trusted_user::_male::_sitelover::_junkie::_kitty::_sun::_turtle:

      Sitefriends

      User Art


    To submit your artwork, follow this link.