Skip to main content

Library for take current proxy from API

Project description

ProxyManager()

При активном использовании прокси во время парсинга возникает проблема постоянного перекидывания прокси из проекта в проект.

Для использования данного модуля: необходимо развернуть АПИ на сервере. использованное api

Установка:

pip install mangust228

Пример получения актуальных прокси:

from mangust228 import ProxyManager

proxies = ProxyManager('your_token', 'your_url')
proxies.get('string') 
# [{http://user:pass@127.0.0.1:8000},...]
proxies.get('dict[str,str]')
# [{'server':'http://127.0.0.1:8000','username':'user','password':'pass'}, ...]
proxies.get('playwright')
# [{'proxy':{'server':'http://127.0.0.1:8000','username':'user','password':'pass'}},...]

Пример получения списка всех прокси (включая просроченные)

proxies = ProxyManager('your_token', 'your_url')
proxies.get_full()

Можно указать путь (только csv!), тогда результат будет сохранен в csv файл

proxies.get_full('all_proxies.csv')

Пример добавления прокси

data = [{
    'server':'127.0.0.1',
    'port':8000,
    'username':'user',
    'password':'pass',
    'expire':'2023-12-31',
    'service':'example.service.com'
},...]
proxies = ProxyManager(token, url)
proxies.post(data=data)

Можно добавлять из файлов excel или csv

proxies.post(path='example.csv')

Пример удаления прокси

proxies.delete(id)

Пример изменения прокси

data = {
    'id':1,
    'username':'John'
}
proxies.put(data)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mangust228-0.5.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

mangust228-0.5-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file mangust228-0.5.tar.gz.

File metadata

  • Download URL: mangust228-0.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for mangust228-0.5.tar.gz
Algorithm Hash digest
SHA256 71ed72247e49da7d093a2477f09714ca3403ff3951d9b712f76adf312c6af0cd
MD5 526fe66a08d1e9ab81c87b417250766e
BLAKE2b-256 9633176926ea43b080167093d0c00e305d3ed743116cbdb69cdf8ef5cd3a0d03

See more details on using hashes here.

File details

Details for the file mangust228-0.5-py3-none-any.whl.

File metadata

  • Download URL: mangust228-0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for mangust228-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8b7ba25d4d9f6f6dd59f2ce7eb1f91922c9166597971e4775a9f2dc3e7b84c38
MD5 2ee22fe86ab05b5a4c2c5d520b3c42c7
BLAKE2b-256 b711535dc4c5ae2778a8d14cb02c878199a100970e2a2d5a6300346b7f9e3c60

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page