-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: mod list supports Gitee #13034
Comments
It's not about offending Github, it's about how we search |
This is probably the API call we want, but I don't read chinese |
To phrase it in a manner that might be considered less tactful and potentially offensive to some: Gitee is essentially GitHub, merely a so-called domestic version within our country, akin to Baidu versus Google, or Huawei versus Apple. Although I am not well-versed in these APIs, I am certain that they must be identical to those of GitHub. Additionally, Gitee also features a star-marking functionality. |
I conducted a test and found that directly using the URL from Gitee to access the mod I placed there allows Unciv to download it without any issues. That URL is: https://gitee.com/AutumnPizazz/CoeHarMod_2 |
I get that, but that does not help me whatsoever in finding mods by an API request. If you take that and convert "github" into "gitee" it does not work. |
It's really frustrating that Gitee doesn't natively support searching by tags.You can only search by keywords,which makes it impossible to accurately filter out mod repositories.The good news is that I found the correct URL that doesn't support tags:https://gitee.com/api/v5/search/repositories?q=unciv&access_token=your_token&page=1&per_page=20 |
However, we need a token to get URL. Like AI's reply: How to Obtain a Gitee Access Token (for API Use)Step 1: Log in to Your Gitee Account
Step 2: Navigate to the "Personal Access Tokens" Page
Step 3: Generate a New Token
Scope DetailsSelect permissions required for your use case:
Example: Step 4: Save the Token
Step 5: Use the Token in Your CodeInclude the token in API requests via the import requests
token = "your_token_here"
url = f"https://gitee.com/api/v5/user?access_token={token}"
response = requests.get(url)
print(response.json()) # Returns user data Important Notes
API Example: Search RepositoriesTo search repositories programmatically: GET https://gitee.com/api/v5/search/repositories?q=关键词&access_token=your_token Replace |
Now Chinese players can download mods from gitee. If players cannot see the mod list in the game due to network problems, I think it would be better to make a mod list website for these players. The website will display the mod's github address and gitee address. |
The token thing is Not Great @FlapyPan 's idea has merit though. If we only have a small number of 'external mods', we could provide them as just a file within the game, and that can accomodate other sources like Gitlab as well. But they'll be star-less 🤔 |
Remember my GraphQL offer a year ago... Same thing. That one had the user enter their own token into Unciv (optionally, to enable mod autoupdates), solving both the API requirements and getting each user their own rate limit... And since GraphQL is a nice open standard (despite having been developed by And any website or similar would have to be manually curated - that should better happen outside this project? Edit: And didn't I do an abstract interface thingy in that branch so adding more sources would become easy by just adding another implementation, plugin-style? |
Before creating
Problem Description
You know,players from Mainland China have difficulty accessing GitHub to obtain mods,but they can access Gitee.I hope the game can pull mods that meet the tag requirements from Gitee.If you think this might offend GitHub,it would also be a good choice to make this feature available only in Simplified Chinese.Thank you.
Related Issue Links
No response
Desired Solution
see above
Alternative Approaches
see above
Additional Context
No response
The text was updated successfully, but these errors were encountered: