proxy-seller-user-api 2.1.1__tar.gz → 2.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: proxy_seller_user_api
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: Client library for the proxy-seller.com Client API v2
5
5
  Home-page: https://github.com/proxy-seller/user-api-python
6
6
  Author: proxy-seller
@@ -668,6 +668,19 @@ Downloads return a file, not the envelope: `text/plain` for `txt` and custom tem
668
668
  `proxyDownload('subresident', package_key='KEY')` for a subpackage and
669
669
  `proxyDownloadResident(id=...)` for the main package.
670
670
 
671
+ Residential lines take the connection scheme in `protocol` (`http` or `socks5`) and the gateway
672
+ in `host`. With `txt` a line becomes `socks5://login:password@host:port`, `csv` keeps its
673
+ columns, and a custom template gets the value in `%protocol%`; without `protocol` the lines have
674
+ no scheme, as before. Login, password and ports are the same for both protocols. `socks5` also
675
+ carries UDP and HTTP/3 (QUIC) to websites. Gateways: `res.proxy-seller.com` (Europe, the
676
+ default), `us.res.proxy-seller.com`, `asia.res.proxy-seller.com` — pick the one closest to your
677
+ server. This is not `proto`, which selects IPv4 ports:
678
+
679
+ ```python
680
+ api.proxyDownloadResident(id='LIST_ID', protocol='socks5', host='us.res.proxy-seller.com')
681
+ api.proxyDownload('subresident', ext='txt', package_key='KEY', protocol='http')
682
+ ```
683
+
671
684
  ## Resident and subuser lists
672
685
 
673
686
  `resident/lists` returns a **flat array** (no `items` wrapper).
@@ -810,6 +823,10 @@ Changes made after the 2.0 release, in the order the server shipped them:
810
823
  - **2.1.1: `{type}` is URL-encoded in the path** of `reference/list`, `proxy/list`,
811
824
  `proxy/download`, `prolong/*` and `autoprolong/*`, as in the other SDKs. A `/` in the value
812
825
  used to split the path, and the request queue then took a `prolong/make` call for a read.
826
+ - **Unreleased: `protocol` and `host` in residential exports.** `proxyDownloadResident()` takes
827
+ `protocol=` and `host=`, and `proxyDownload('subresident', ...)` passes them on as filters: the
828
+ connection scheme (`http` / `socks5`) and the gateway in the lines. Without them the request and
829
+ the lines are the same as before — see [Proxies](#proxies).
813
830
 
814
831
  ## Tests
815
832
 
@@ -624,6 +624,19 @@ Downloads return a file, not the envelope: `text/plain` for `txt` and custom tem
624
624
  `proxyDownload('subresident', package_key='KEY')` for a subpackage and
625
625
  `proxyDownloadResident(id=...)` for the main package.
626
626
 
627
+ Residential lines take the connection scheme in `protocol` (`http` or `socks5`) and the gateway
628
+ in `host`. With `txt` a line becomes `socks5://login:password@host:port`, `csv` keeps its
629
+ columns, and a custom template gets the value in `%protocol%`; without `protocol` the lines have
630
+ no scheme, as before. Login, password and ports are the same for both protocols. `socks5` also
631
+ carries UDP and HTTP/3 (QUIC) to websites. Gateways: `res.proxy-seller.com` (Europe, the
632
+ default), `us.res.proxy-seller.com`, `asia.res.proxy-seller.com` — pick the one closest to your
633
+ server. This is not `proto`, which selects IPv4 ports:
634
+
635
+ ```python
636
+ api.proxyDownloadResident(id='LIST_ID', protocol='socks5', host='us.res.proxy-seller.com')
637
+ api.proxyDownload('subresident', ext='txt', package_key='KEY', protocol='http')
638
+ ```
639
+
627
640
  ## Resident and subuser lists
628
641
 
629
642
  `resident/lists` returns a **flat array** (no `items` wrapper).
@@ -766,6 +779,10 @@ Changes made after the 2.0 release, in the order the server shipped them:
766
779
  - **2.1.1: `{type}` is URL-encoded in the path** of `reference/list`, `proxy/list`,
767
780
  `proxy/download`, `prolong/*` and `autoprolong/*`, as in the other SDKs. A `/` in the value
768
781
  used to split the path, and the request queue then took a `prolong/make` call for a read.
782
+ - **Unreleased: `protocol` and `host` in residential exports.** `proxyDownloadResident()` takes
783
+ `protocol=` and `host=`, and `proxyDownload('subresident', ...)` passes them on as filters: the
784
+ connection scheme (`http` / `socks5`) and the gateway in the lines. Without them the request and
785
+ the lines are the same as before — see [Proxies](#proxies).
769
786
 
770
787
  ## Tests
771
788
 
@@ -2206,7 +2206,10 @@ class Api:
2206
2206
  csv — '%ip%;%port%;%login%;%password%'). Ограничения см. assertExt().
2207
2207
  proto (str): https | socks5 | None (иные значения сервер игнорирует)
2208
2208
  listId (str): only for resident-family types
2209
- filters: package_key (ТОЛЬКО subresident), country (код страны), ends
2209
+ filters: package_key (ТОЛЬКО subresident), country (код страны), ends,
2210
+ protocol и host — схема (http | socks5) и шлюз в строках резидентов, только
2211
+ resident и subresident (см. proxyDownloadResident()). protocol — это не proto:
2212
+ proto выбирает порты IPv4
2210
2213
 
2211
2214
  Note:
2212
2215
  Для резидентских листов основного пакета используйте proxyDownloadResident().
@@ -2227,7 +2230,7 @@ class Api:
2227
2230
  return self.request('GET', 'proxy/download/' + self._segment(type),
2228
2231
  params=self.filterNone(params))
2229
2232
 
2230
- def proxyDownloadResident(self, id=None, ext=None, maxLine=None):
2233
+ def proxyDownloadResident(self, id=None, ext=None, maxLine=None, protocol=None, host=None):
2231
2234
  """
2232
2235
  Export the resident proxy list (файл, attachment).
2233
2236
 
@@ -2240,12 +2243,20 @@ class Api:
2240
2243
  это не ObjectId.
2241
2244
  ext (str): txt | csv | кастомный шаблон (см. proxyDownload)
2242
2245
  maxLine (int): Maximum number of lines.
2246
+ protocol (str): http | socks5. При txt строка становится
2247
+ ``socks5://login:password@host:port``, csv не меняется, кастомный шаблон
2248
+ получает значение в %protocol%; None — строки без схемы, как раньше. Логин,
2249
+ пароль и порты у обоих протоколов одни; socks5 несёт ещё UDP и HTTP/3 (QUIC)
2250
+ к сайтам. Не путать с proto у proxyDownload(): тот выбирает порты IPv4.
2251
+ host (str): шлюз — res.proxy-seller.com (по умолчанию), us.res.proxy-seller.com,
2252
+ asia.res.proxy-seller.com.
2243
2253
 
2244
2254
  Returns:
2245
2255
  str: The exported proxies.
2246
2256
  """
2247
2257
  return self.request('GET', 'proxy/download/resident', params=self.filterNone(
2248
- {'id': id, 'ext': self.assertExt(ext), 'maxLine': maxLine}))
2258
+ {'id': id, 'ext': self.assertExt(ext), 'maxLine': maxLine,
2259
+ 'protocol': protocol, 'host': host}))
2249
2260
 
2250
2261
  #: Допустимые значения type у proxy/replace — ПРИЧИНА замены.
2251
2262
  PROXY_REPLACE_TYPES = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: proxy_seller_user_api
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: Client library for the proxy-seller.com Client API v2
5
5
  Home-page: https://github.com/proxy-seller/user-api-python
6
6
  Author: proxy-seller
@@ -668,6 +668,19 @@ Downloads return a file, not the envelope: `text/plain` for `txt` and custom tem
668
668
  `proxyDownload('subresident', package_key='KEY')` for a subpackage and
669
669
  `proxyDownloadResident(id=...)` for the main package.
670
670
 
671
+ Residential lines take the connection scheme in `protocol` (`http` or `socks5`) and the gateway
672
+ in `host`. With `txt` a line becomes `socks5://login:password@host:port`, `csv` keeps its
673
+ columns, and a custom template gets the value in `%protocol%`; without `protocol` the lines have
674
+ no scheme, as before. Login, password and ports are the same for both protocols. `socks5` also
675
+ carries UDP and HTTP/3 (QUIC) to websites. Gateways: `res.proxy-seller.com` (Europe, the
676
+ default), `us.res.proxy-seller.com`, `asia.res.proxy-seller.com` — pick the one closest to your
677
+ server. This is not `proto`, which selects IPv4 ports:
678
+
679
+ ```python
680
+ api.proxyDownloadResident(id='LIST_ID', protocol='socks5', host='us.res.proxy-seller.com')
681
+ api.proxyDownload('subresident', ext='txt', package_key='KEY', protocol='http')
682
+ ```
683
+
671
684
  ## Resident and subuser lists
672
685
 
673
686
  `resident/lists` returns a **flat array** (no `items` wrapper).
@@ -810,6 +823,10 @@ Changes made after the 2.0 release, in the order the server shipped them:
810
823
  - **2.1.1: `{type}` is URL-encoded in the path** of `reference/list`, `proxy/list`,
811
824
  `proxy/download`, `prolong/*` and `autoprolong/*`, as in the other SDKs. A `/` in the value
812
825
  used to split the path, and the request queue then took a `prolong/make` call for a read.
826
+ - **Unreleased: `protocol` and `host` in residential exports.** `proxyDownloadResident()` takes
827
+ `protocol=` and `host=`, and `proxyDownload('subresident', ...)` passes them on as filters: the
828
+ connection scheme (`http` / `socks5`) and the gateway in the lines. Without them the request and
829
+ the lines are the same as before — see [Proxies](#proxies).
813
830
 
814
831
  ## Tests
815
832
 
@@ -12,7 +12,7 @@ setup(
12
12
  name='proxy_seller_user_api',
13
13
  # 2.x = Client API v2 (baseUrl .../personal/api/v2/, ObjectId-строки, конверт
14
14
  # {status, data, errors}). 2.1 добавляет balance/autotopup/get и /set.
15
- version='2.1.1',
15
+ version='2.1.2',
16
16
  author='proxy-seller',
17
17
  author_email='support@proxy-seller.com',
18
18
  description='Client library for the proxy-seller.com Client API v2',
@@ -139,6 +139,26 @@ class ProxyDownloadTest(unittest.TestCase):
139
139
  api.proxyDownload('resident', ext='txt')
140
140
  self.assertEqual(session.last['params'], {'ext': 'txt'})
141
141
 
142
+ def test_resident_protocol_and_host_are_sent(self):
143
+ api, session = make_api([text_file('socks5://a:b@us.res.proxy-seller.com:10000')])
144
+ api.proxyDownloadResident('561', 'txt', 10, protocol='socks5', host='us.res.proxy-seller.com')
145
+ call = session.last
146
+ self.assertTrue(call['url'].endswith('proxy/download/resident'))
147
+ self.assertEqual(call['params'], {'id': '561', 'ext': 'txt', 'maxLine': 10,
148
+ 'protocol': 'socks5', 'host': 'us.res.proxy-seller.com'})
149
+
150
+ def test_resident_without_protocol_and_host_is_unchanged(self):
151
+ api, session = make_api([text_file('a:b@res.proxy-seller.com:10000')])
152
+ api.proxyDownloadResident('561', 'txt', 10)
153
+ self.assertEqual(session.last['params'], {'id': '561', 'ext': 'txt', 'maxLine': 10})
154
+
155
+ def test_subresident_protocol_and_host_are_sent(self):
156
+ api, session = make_api([text_file('http://a:b@asia.res.proxy-seller.com:10000')])
157
+ api.proxyDownload('subresident', ext='txt', package_key='PKG',
158
+ protocol='http', host='asia.res.proxy-seller.com')
159
+ self.assertEqual(session.last['params'], {'ext': 'txt', 'package_key': 'PKG',
160
+ 'protocol': 'http', 'host': 'asia.res.proxy-seller.com'})
161
+
142
162
  def test_ext_validation(self):
143
163
  with self.assertRaises(ValueError):
144
164
  Api.assertExt('a' * 251)