Updates Failing Since May 2025 - Fixes#13
Updates Failing Since May 2025 - Fixes#13ReverseTelnet wants to merge 12 commits intoHamletDuFromage:masterfrom
Conversation
|
Hi! Thank you for your PR! |
Looking through the git log, I did notice that you switched from requests to cloudscraper. However, when a script is ostensibly scraping a website, particularly in the last few years with rise of AI, it does run the risk of being flagged as a bot. My thought in this PR is this: In the current state of this script, it cannot be run locally by anyone who clones it. >>> import os
>>> import cloudscraper
>>>
>>> scraper = cloudscraper.create_scraper()
>>> api_url = "https://api.github.com/repos/ChanseyIsTheBest/NX-60FPS-RES-GFX-Cheats/branches/main"
>>> token = os.getenv('GITHUB_TOKEN')
>>> type(token)
<class 'NoneType'>
>>> headers = {'Authorization': f'token {token}'}
>>> headers
{'Authorization': 'token None'}
>>> repo_info = scraper.get(api_url, headers=headers).json()
>>> repo_info
{'message': 'Bad credentials', 'documentation_url': 'https://docs.github.com/rest', 'status': '401'}By adding the if/else logic: >>> scraper = cloudscraper.create_scraper()
>>> api_url = "https://api.github.com/repos/ChanseyIsTheBest/NX-60FPS-RES-GFX-Cheats/branches/main"
>>> token = os.getenv('GITHUB_TOKEN')
>>> if token is not None:
... headers = {'Authorization': f'token {token}'}
... else:
... headers = {}
...
>>> type(token)
<class 'NoneType'>
>>> headers
{}
>>> repo_info = scraper.get(api_url, headers=headers).json()
>>> repo_info
{
'name': 'main',
'commit': {
'sha': 'b6da540c2a9491f1aefd8e82e1fd672923e58a32',
'node_id': 'C_kwDOIjYr-toAKGI2ZGE1NDBjMmE5NDkxZjFhZWZkOGU4MmUxZmQ2NzI5MjNlNThhMzI',
'commit': {
'author': {'name': 'ChanseyIsTheBest', 'email': '117623814+ChanseyIsTheBest@users.noreply.github.com', 'date': '2025-12-20T01:19:07Z'},
'committer': {'name': 'ChanseyIsTheBest', 'email': 'ChanseyIsTheBest@users.noreply.github.com', 'date': '2025-12-20T01:19:25Z'},
'message': 'remove broken cheat',
'tree': {
'sha': '3b3a73a0f455090929afc0da5a436a3b998e748a',
'url': 'https://api.github.com/repos/ChanseyIsTheBest/NX-60FPS-RES-GFX-Cheats/git/trees/3b3a73a0f455090929afc0da5a436a3b998e748a'
},This may not solve for Bot detection, but it does allow this script to be run someone who clones it. The other The result is that the various directories the script creates won't be present on the machine. However, it does full-stop prevent anyone else from running the script locally unless they make changes to the script. I am trying to 'split the difference' between the underlying issues. (1) The core issue for you are the author, maintainer, Switch app author/Wizard, if I understand it correctly from your response above and from this comment on Issue 10 has to due with how these website are managing bots and preceived-bots. (2) The core issue for the uninitiated user is "it doesn't work / no updates since May 2025." (3) The core issue for the initiated user is that the script hits multiple tracebacks and can't be run. I don't know how to solve for the first. If the user can run this script locally, then they can either transfer and extract the updated zip file locally on the switch or potentially point the aio-switch-updater to the locally compiled updated cheat zip file. |
See Issue #12 for details on this PR.