utils_get_current_ip.py 432 B

12345678910111213141516171819202122232425
  1. # -*- coding: utf-8 -*-
  2. import aiohttp
  3. import asyncio
  4. async def fetch(url):
  5. async with aiohttp.ClientSession() as session:
  6. async with session.get(url) as response:
  7. return await response.text()
  8. async def main():
  9. url = 'http://api.ip.cc'
  10. content = await fetch(url)
  11. print(content)
  12. asyncio.run(main())
  13. '''
  14. Proxy server: 175.99.17.215
  15. port: 6011
  16. username: lumi-jiege0210
  17. password: aaaAAA111
  18. '''