Septzzz's picture
Upload folder using huggingface_hub (part 25)
7d0f0c3 verified
Raw
History Blame Contribute Delete
1.54 kB
import requests
import json
from datetime import date, datetime, timedelta
import os
from typing import Optional, Dict, Union, List
def captcha_answer(action: str, key: str, is_id: str='CAPTCHA_ID', toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This endpoint is used to get the CAPTCHA answer."
"""
url = f"https://captchas-io1.p.rapidapi.com/"
querystring = {'action': action, 'key': key, }
if is_id:
querystring['id'] = is_id
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "captchas-io1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def https_api_captchas_io_in_php(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"The in.php API endpoint is the endpoint where you will make a GET / POST HTTP request to get a CAPTCHA solving task ID and start the solver."
"""
url = f"https://captchas-io1.p.rapidapi.com/"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "captchas-io1.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation