Files
Click/test_twitch_referer.py
T
2026-05-14 16:15:58 +07:00

45 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# test_twitch_referer.py
"""
Проверка что переход идет с Referer от Twitch.
"""
import asyncio
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from managers.proxy_manager import ProxyManager
from services.browser_service import BrowserService
async def test():
pm = ProxyManager()
bs = BrowserService(pm)
# Проверяем через httpbin - он покажет все заголовки
print("=" * 60)
print("🧪 ТЕСТ REFERER ОТ TWITCH")
print("=" * 60)
# 2. Посещение с Twitch Referer
print("\n2️⃣ Посещение с Referer от Twitch:")
result2 = await bs.visit_page(
url="https://uplify.pro/c/qtmhxbb?erid=2VtzquyZCUw",
reading_time=50
)
print(f" Статус: {'' if result2.success else ''}")
print(f" URL: {result2.final_url}")
# 3. Проверка Referer через другой сервис
print("\n3️⃣ Проверка Referer:")
result3 = await bs.visit_page_from_twitch(
url="https://httpbin.org/headers",
channel="shroud",
reading_time=3
)
print(f" Статус: {'' if result3.success else ''}")
await bs.cleanup()
print("\n✅ Готово! Проверьте httpbin.org/headers в браузере для сравнения.")
asyncio.run(test())