Cookies and API keys
This page explains how to obtain a site's credentials (a cookie, an API key or a passkey), which pt-tools needs before it can do anything with the site.
The ways sites sign in
pt-tools supports three ways of authenticating with a site:
| Method | Sites | Characteristics | Recommended setup |
|---|---|---|---|
| Cookie | HDSky, SpringSunday, HDDolby, NovaHD | The traditional way; expires from time to time | ✅ Synced automatically by the browser extension |
| API key | M-Team | Valid for a long time | Entered by hand |
| Passkey | Rousi Pro | Valid for a long time | Entered by hand |
For sites that use a cookie, the browser extension is strongly recommended. It saves you copying and pasting by hand, and updates the cookie when it expires.
Option 1: sync automatically with the browser extension (recommended)
Once you are signed in to a site, the PT Tools Helper browser extension sends its cookie to pt-tools in one click, with no developer tools and no copying and pasting.
The extension follows your browser's language; the labels below are its English ones.
Installing the extension
Edge: install it from the Edge Add-ons store (recommended; updates itself, but each release waits about a week for Microsoft's review)
In Microsoft Edge, go to Edge Add-ons, search for "PT Tools Helper" and install it. The store is for Edge only; Chrome cannot install from it.
Chrome or Edge: install it by hand (does not update itself)
Firefox can only load it temporarily; the steps are in Browser extension.
- Download the latest
pt-tools-helper.zipfrom GitHub Releases - Unpack it into a folder you keep (do not delete it afterwards: the browser keeps reading it)
- Open the browser's extensions page:
- Chrome →
chrome://extensions - Edge →
edge://extensions
- Chrome →
- Turn on Developer mode at the top right
- Click Load unpacked and choose the unpacked folder
- The extension's icon appears in the toolbar (the same icon as pt-tools: a teal chevron and an orange block on a dark square)
- Click the icon for the first time and choose 🔓 Grant & Enable to give it the permissions it needs
Connecting to pt-tools
The extension needs pt-tools' address before it can sync cookies:
- Click the extension's icon in the toolbar
- In Global Settings at the bottom, fill in:
- pt-tools URL: the address of your pt-tools service (such as
http://localhost:8080orhttp://192.168.1.100:8080) - Username (optional): your pt-tools user name
- Password (optional): your pt-tools password
- pt-tools URL: the address of your pt-tools service (such as
- Click 🔗 Test Connection to check the connection
- When it works, the extension shows "Connected to pt-tools. Settings saved."
If pt-tools runs on another machine or in Docker, make sure the address you enter can be reached from this browser.
Syncing one site's cookie
- Sign in to the site in the browser as usual (HDSky, for example)
- Click the extension's icon; it shows ✅ HDSky (NexusPHP)
- Check that the cookie status is Valid
- Click 🔄 Sync Cookie to pt-tools
- A confirmation appears once the sync succeeds
After the sync, the site's cookie in pt-tools is updated; there is nothing to fill in in the pt-tools web interface.
Syncing every site's cookie at once
If you are signed in to several sites, you can sync all their cookies in one go:
- Click the extension's icon
- Expand Global Settings at the bottom
- Batch Cookie Sync lists every built-in site
- Each site shows its cookie status (Valid, Expiring Soon, Expired or Missing)
- Tick the sites you want to sync (or click Select All)
- Click 🔄 Sync Selected
Note: sites that use an API key or a passkey (such as M-Team and Rousi Pro) are greyed out and cannot be selected; their credentials are entered in pt-tools by hand.
Turning on automatic sync
With automatic sync on, a cookie change is pushed to pt-tools whenever you visit the site in the browser:
- Visit the site
- Click the extension's icon
- Turn on Auto-sync Cookie
From then on, every cookie update (signing in again, a refreshed cookie) is synced to pt-tools automatically. Syncs of the same site are at least 30 seconds apart, and each result is shown as a browser notification.
Option 2: obtain the credentials by hand
If you would rather not install the extension, or the site uses an API key or a passkey, use the manual methods below.
Cookie authentication
What a cookie is
A cookie is a small piece of data a website stores in the browser to keep you signed in. Sites recognise a signed-in user by the cookie.
Sites: HDSky, SpringSunday, HDDolby, NovaHD and the other sites that run NexusPHP.
Getting it by hand in Chrome or Edge
Step 1: sign in to the site
Make sure you are signed in to the site and can browse its pages normally.
Step 2: open the developer tools
Open the developer tools in any of these ways:
- Press
F12 - Press
Ctrl + Shift + I(Windows/Linux) orCmd + Option + I(Mac) - Right-click an empty part of the page and choose Inspect
Step 3: switch to the Network tab
In the developer tools, click the Network tab at the top.
Step 4: reload the page
Press F5 or click the browser's reload button, so the developer tools capture the requests.
Step 5: choose a request and copy the cookie
- In the list of requests, click the first one (usually the page itself)
- In the panel on the right, open the Headers tab
- Scroll down to Request Headers
- Find the
Cookiefield - Copy the whole value of the cookie (it is usually long and holds several key-value pairs)
What a cookie looks like:
c_secure_uid=xxxxx; c_secure_pass=xxxxx; c_secure_ssl=xxxxx; c_secure_tracker_ssl=xxxxxGetting it by hand in Firefox
Steps 1 and 2: as in Chrome; sign in to the site and press F12 to open the developer tools.
Step 3: click the Network tab.
Step 4: reload the page.
Step 5:
- Click any request
- Under Headers on the right, find Request Headers
- Copy the full value of the
Cookiefield
Questions about cookies
Q: How long does a cookie last?
A: On most sites a cookie lasts between one and four weeks. With the extension and automatic sync on, cookie updates are pushed to pt-tools without any work on your part.
Q: How can I make a cookie last longer?
A: Visiting the site regularly refreshes the cookie. On some sites the "remember me" option makes it last longer. With the extension's automatic sync, the cookie is updated in pt-tools whenever you visit the site.
Q: What do I do when the cookie has expired?
A:
- With the extension: sign in to the site again; the extension notices and syncs the new cookie
- By hand: get the new cookie from the browser and update it in pt-tools
Q: What should I watch out for when copying a cookie?
A:
- Copy the complete cookie string; do not leave anything out
- Do not include the
Cookie:prefix; copy only the value - Do not add spaces or line breaks while copying
API key authentication
What an API key is
An API key is an access token the site generates for you. Compared with a cookie:
- It lasts a long time: it does not expire as often as a cookie
- It can be revoked at any time: if it leaks, you can generate a new one immediately
Sites: M-Team
Getting an M-Team API key
Step 1: sign in to M-Team
Sign in to M-Team in the browser.
Step 2: open the security settings
- Click your avatar or user name at the top right
- Choose Control panel (控制面板) or Settings
- In the menu on the left, find Lab (实验室)
- Click Access tokens (存取令牌)
Step 3: generate an API key
- If you have no API key yet, click Create token (生成新令牌)
- Give the token a name (such as
pt-tools) so you remember what it is for - Confirm to generate it
Step 4: copy the API key
The API key is shown only once after it is generated. Copy it straight away and keep it somewhere safe.
What an API key looks like:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxKeeping an API key safe
- Never share it: an API key is as good as your account password
- Revoke a leaked key at once: if you suspect a leak, revoke the key on the site and generate a new one
- Rotate it: replace the API key every few months
- Never commit it to a repository: keep it in an environment variable or a separate configuration file
Entering the credentials in pt-tools
Way A: through the browser extension (recommended for cookie sites)
After the extension syncs a cookie, the site's credentials in pt-tools are updated automatically; there is nothing to do in the web interface. Make sure that:
- The extension is connected to pt-tools (see Connecting to pt-tools above)
- You clicked Sync Cookie in the extension, or turned on automatic sync
- The site is enabled in pt-tools' site list
Way B: by hand in the web interface
- Sign in to the pt-tools web interface
- Open Sites → Site list (站点 → 站点列表) and click the Site settings and RSS (站点配置与 RSS 订阅) button on the site's row
- On the Overview (概览) tab, turn on Enable site (启用站点)
- Switch to the Credentials (凭据) tab and enter the cookie, API key or passkey
- Click Save settings (保存配置) at the top of the page
NOTE
A saved cookie is never shown again, for security; saving with the field empty keeps the stored value. API keys and passkeys show their current value and cannot be saved empty; to replace one, enter the new value.
Checking the result
After saving, the Status (状态) column of the site list shows how the site is doing:
| Status | Meaning |
|---|---|
| OK (正常) | The site is available and the last login probe succeeded (or none has run yet) |
| Problem (异常) | The site is unavailable, or the last login probe failed |
| Disabled (已禁用) | The site is not enabled |
Click Probe now (立即探测) on the row to check the login status at once; see Login status and key backup.
The methods compared
| Aspect | Cookie (synced by the extension) | Cookie (by hand) | API key |
|---|---|---|---|
| Effort | ⭐ Very low (one click) | Higher (developer tools) | Low (generated on the site) |
| Lifetime | Renewed automatically | One to four weeks | Long |
| How it is set | Pushed by the extension | Pasted by hand | Pasted by hand |
| Security | Average | Average | Better |
| Sites | NexusPHP | NexusPHP | mTorrent |
Troubleshooting
1. Authentication fails
Possible causes:
- The cookie or API key has expired or is no longer valid
- Part of it was left out when copying
- Something is wrong with the account (it has been banned, for example)
What to do:
- Sign in to the site again and check the account is in order
- Get the cookie or API key again
- Make sure you copied all of it, with no extra spaces
2. The connection times out
Possible causes:
- A network problem
- The site is down or under maintenance
- A firewall is blocking the connection
What to do:
- Check the network connection
- Try opening the site in a browser
- Check whether the site has to be reached through a proxy
3. The cookie keeps expiring
Recommended: install the browser extension and turn on automatic sync, so every cookie update is pushed to pt-tools.
Common causes when you manage it by hand:
- The site has a strict security policy
- You have not visited the site for a long time
- Signing in on another device signed you out
What to do:
- Visit the site regularly to stay active
- Tick "remember me" when you sign in
- Avoid being signed in on several devices at once
4. The API key does not work
Possible causes:
- The key has been revoked
- It lacks the permissions needed
- The site's API service has a problem
What to do:
- Check the key's status on the site
- Try generating a new key
- Make sure the site supports API access
Once the credentials are in place, the next step is RSS subscriptions, to set up automatic downloads.