# 入門指南

### **簡介**

**Thordata 高帶寬代理**服務整合全球**70**多個地區的真實住宅 IP 資源。提供1**00+Gbps**帶寬的大規模影片抓取服務，無縫處理各大影片平台海量數據，性能穩定可靠。

要使用我們的高帶寬代理進行音視頻數據抓取，請聯繫銷售團隊，獲取您的專屬代理端點。我們將為每位客戶分配一個根據實際需求定制的獨立代理節點，確保服務高效穩定。

### 端點配置

在帳戶管理團隊向您提供端點後，您將獲得：

* 一個專用的代理端點
* 您的用戶名和密碼
* ​端口號

### 認證方式

動態住宅代理支持兩種**認證方式：**

* [<mark style="color:blue;">**賬密認證**</mark>](/doc/zh-hk/dai-li/gao-dai-kuan-dai-li/zhang-mi-ren-zheng.md)
* [<mark style="color:blue;">**白名單IP**</mark>](/doc/zh-hk/dai-li/gao-dai-kuan-dai-li/bai-ming-dan-ip.md)

### 为每次下载设置会话

為確保最佳成功率，高帶寬代理在每次會話期間會自動進行負載均衡。只需在用戶名後添加 `sessid-[自定義會話標識]+sesstime-[持續時間]` 參數，系統便會生成一個隨機數作為會話 ID，並為每次下載自動分配不同的 IP 地址。

{% tabs %}
{% tab title="cURL" %}

```sh
curl -x "https://td-customer-USERNAME-country-us-sessid-a123123-sesstime-10:PASSWORD@t.thordata.online:9999" "https://ipinfo.thordata.com"
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;

class csharp_https
{
    static void Main(string[] args)
    {
        Task t = new Task(DownloadPageAsync);
        t.Start();
        Console.ReadLine();
    }

    static async void DownloadPageAsync()
    {
        string page = "https://ipinfo.thordata.com";

        var proxy = new WebProxy("https://t.thordata.online:9999")
        {
            UseDefaultCredentials = false,
            Credentials = new NetworkCredential(
                userName: "td-customer-USERNAME-country-us-sessid-a123123-sesstime-10",
                password: "PASSWORD")
        };

        var httpClientHandler = new HttpClientHandler()
        {
            Proxy = proxy,
            ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
        };

        var client = new HttpClient(handler: httpClientHandler, disposeHandler: true);
        var response = await client.GetAsync(page);

        using (HttpContent content = response.Content)
        {
            string result = await content.ReadAsStringAsync();
            Console.WriteLine(result);
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
)

const (
	resourceUrl = "https://ipinfo.thordata.com"
	proxyHost   = "t.thordata.online:9999"
	username    = "td-customer-USERNAME-country-us-sessid-a123123-sesstime-10"
	password    = "PASSWORD"
)

func main() {
	proxyUrl := &url.URL{
		Scheme: "https",
		User:   url.UserPassword(username, password),
		Host:   proxyHost,
	}

	client := http.Client{
		Transport: &http.Transport{
			Proxy: http.ProxyURL(proxyUrl),
		},
	}

	resp, err := client.Get(resourceUrl)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}

	bodyString := string(body)
	fmt.Println(bodyString)
}
```

{% endtab %}

{% tab title="Java" %}

```java
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

public class JavaHttps {
    public static final String username = "td-customer-USERNAME-country-us-sessid-a123123-sesstime-10";
    public static final String password = "PASSWORD";
    public static final int port = 9999;
    public static final String proxyHost = "t.thordata.online";
    public CloseableHttpClient client;

    public JavaHttps() {
        HttpHost proxy = new HttpHost(proxyHost, port, "https");
        CredentialsProvider cred_provider = new BasicCredentialsProvider();
        cred_provider.setCredentials(new AuthScope(proxy),
                new UsernamePasswordCredentials(username, password));
        client = HttpClients.custom()
                .setConnectionManager(new BasicHttpClientConnectionManager())
                .setProxy(proxy)
                .setDefaultCredentialsProvider(cred_provider)
                .build();
    }

    public String request(String url) throws IOException {
        HttpGet request = new HttpGet(url);
        CloseableHttpResponse response = client.execute(request);
        try {
            return EntityUtils.toString(response.getEntity());
        } finally { response.close(); }
    }

    public void close() throws IOException { client.close(); }

    public static void main(String[] args) throws IOException {
        JavaHttps client = new JavaHttps();
        try {
            System.out.println(client.request("https://ipinfo.thordata.com"));
        } finally { client.close(); }
    }
}

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
  $url = 'https://ipinfo.thordata.com';
  $proxy = 't.thordata.online';
  $port = 9999;
  $user = 'td-customer-USERNAME-country-us-sessid-a123123-sesstime-10';
  $psw = 'PASSWORD';

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

  curl_setopt($ch, CURLOPT_PROXY, "$proxy:$port");
  curl_setopt($ch, CURLOPT_PROXYUSERPWD, "$user:$psw");
  $result = curl_exec($ch);
  curl_close($ch);

  if ($result)
  {
      echo $result . PHP_EOL;
  }
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

username = "td-customer-USERNAME-country-us-sessid-a123123-sesstime-10"
password = "PASSWORD"
proxy_server = "t.thordata.online:9999"

proxies = {"https": f"https://{username}:{password}@{proxy_server}"}

response = requests.get("https://ipinfo.thordata.com", proxies=proxies)
print(response.text)
```

{% endtab %}

{% tab title="Node.js" %}

```
const rp = require('request-promise');

const username = "td-customer-USERNAME-country-us-sessid-a123123-sesstime-10";
const password = "PASSWORD";
const proxyServer = "t.thordata.online:9999";

rp({
    url: 'https://ipinfo.thordata.com',
    proxy: `https://${username}:${password}@${proxyServer}`,
})
.then(function(data) {
    console.log(data);
})
.catch(function(err) {
    console.error(err);
});
```

{% endtab %}

{% tab title="Untitled" %}

```ruby
require "uri"
require 'net/http'
require 'openssl'

proxy_host = 't.thordata.online'
proxy_port = 9999
proxy_user = 'td-customer-USERNAME-country-us-sessid-a123123-sesstime-10'
proxy_pass = 'PASSWORD'

uri = URI.parse('https://ipinfo.thordata.com')

proxy = Net::HTTP::Proxy(proxy_host, proxy_port, proxy_user, proxy_pass)

req = Net::HTTP::Get.new(uri)

result = proxy.start(uri.host, uri.port, use_ssl: true, ssl_version: :TLSv1_2) do |http|
  http.request(req)
end

puts result.body
```

{% endtab %}
{% endtabs %}

如需將代理直接集成到 yt-dlp 等工具中，請參閱以下頁面：

### **需要幫助？**

**如果您需要進一步說明或位置定位方面的幫助，請隨時通過以下方式與我們聯繫**：

**Email**: [**support@thordata.com**](https://www.notion.so/24851eb97e35808cb829fa141e4915f3?pvs=21)

**Live Chat**: Thordata 在[<mark style="color:blue;">**官網**</mark>](https://www.thordata.com/zh-hk) 提供24/7 Live Chat


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.thordata.com/doc/zh-hk/dai-li/gao-dai-kuan-dai-li/ru-men-zhi-nan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
