mirror of
https://github.com/yeongpin/cursor-free-vip.git
synced 2025-08-03 04:57:36 +08:00
Merge pull request #630 from canmi21/main
update: aur release 1.9.04 & fix(linux): pkg name & fix(chrome): oauth error
This commit is contained in:
commit
d60c46bac6
5
.SRCINFO
5
.SRCINFO
@ -1,10 +1,11 @@
|
|||||||
pkgbase = cursor-free-vip-git
|
pkgbase = cursor-free-vip-git
|
||||||
pkgdesc = Reset Cursor AI MachineID & Auto Sign Up / In & Bypass Higher Token Limit
|
pkgdesc = Reset Cursor AI MachineID & Auto Sign Up / In & Bypass Higher Token Limit
|
||||||
pkgver = 1.9.03.2.g43a58db
|
pkgver = 1.9.04.10.g5863891
|
||||||
pkgrel = 1
|
pkgrel = 1
|
||||||
url = https://github.com/yeongpin/cursor-free-vip
|
url = https://github.com/yeongpin/cursor-free-vip
|
||||||
arch = x86_64
|
arch = x86_64
|
||||||
license = MIT
|
license = MIT
|
||||||
|
license = Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||||
makedepends = git
|
makedepends = git
|
||||||
makedepends = python
|
makedepends = python
|
||||||
makedepends = pyinstaller
|
makedepends = pyinstaller
|
||||||
@ -13,6 +14,8 @@ pkgbase = cursor-free-vip-git
|
|||||||
depends = cursor-bin
|
depends = cursor-bin
|
||||||
provides = cursor-free-vip
|
provides = cursor-free-vip
|
||||||
source = cursor-free-vip::git+https://github.com/yeongpin/cursor-free-vip.git
|
source = cursor-free-vip::git+https://github.com/yeongpin/cursor-free-vip.git
|
||||||
|
source = https://raw.githubusercontent.com/canmi21/openjlc/refs/heads/main/LICENSE
|
||||||
|
sha256sums = SKIP
|
||||||
sha256sums = SKIP
|
sha256sums = SKIP
|
||||||
|
|
||||||
pkgname = cursor-free-vip-git
|
pkgname = cursor-free-vip-git
|
||||||
|
10
PKGBUILD
10
PKGBUILD
@ -2,17 +2,17 @@
|
|||||||
# Contributor: Canmi (Canmi21)
|
# Contributor: Canmi (Canmi21)
|
||||||
|
|
||||||
pkgname=cursor-free-vip-git
|
pkgname=cursor-free-vip-git
|
||||||
pkgver=1.9.03.2.g43a58db
|
pkgver=1.9.04.10.g5863891
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Reset Cursor AI MachineID & Auto Sign Up / In & Bypass Higher Token Limit"
|
pkgdesc="Reset Cursor AI MachineID & Auto Sign Up / In & Bypass Higher Token Limit"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url="https://github.com/yeongpin/cursor-free-vip"
|
url="https://github.com/yeongpin/cursor-free-vip"
|
||||||
license=('MIT')
|
license=('MIT' 'Attribution-NonCommercial-NoDerivatives 4.0 International')
|
||||||
depends=('python' 'cursor-bin')
|
depends=('python' 'cursor-bin')
|
||||||
makedepends=('git' 'python' 'pyinstaller' 'uv')
|
makedepends=('git' 'python' 'pyinstaller' 'uv')
|
||||||
provides=('cursor-free-vip')
|
provides=('cursor-free-vip')
|
||||||
source=("cursor-free-vip::git+https://github.com/yeongpin/cursor-free-vip.git")
|
source=("cursor-free-vip::git+https://github.com/yeongpin/cursor-free-vip.git" "https://raw.githubusercontent.com/canmi21/openjlc/refs/heads/main/LICENSE")
|
||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP' 'SKIP')
|
||||||
|
|
||||||
pkgver() {
|
pkgver() {
|
||||||
cd "$srcdir/cursor-free-vip"
|
cd "$srcdir/cursor-free-vip"
|
||||||
@ -28,5 +28,7 @@ build() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
|
install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/mit_license"
|
||||||
|
install -Dm644 "$srcdir/cursor-free-vip/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/attribution_non_commercial_no_derivatives_license"
|
||||||
install -Dm755 "$srcdir/cursor-free-vip/dist/cursor-free-vip" "$pkgdir/usr/bin/cursor-free-vip"
|
install -Dm755 "$srcdir/cursor-free-vip/dist/cursor-free-vip" "$pkgdir/usr/bin/cursor-free-vip"
|
||||||
}
|
}
|
16
README.md
16
README.md
@ -40,10 +40,10 @@ Always clean your browser's cache and cookies. If possible, use a VPN to create
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
##### If you don't have browser, you can download it from
|
##### If you don't have browser, you can download it from
|
||||||
[Google Chrome](https://www.google.com/intl/en_pk/chrome/) or [Opera](https://www.opera.com/download) or [Edge](https://www.microsoft.com/en-us/edge) or [Firefox](https://www.mozilla.org/en-US/firefox/new/) or [Brave](https://www.brave.com/download/)
|
|
||||||
|
|
||||||
##### 如果沒有瀏覽器,可以從
|
##### 如果沒有瀏覽器,可以從这里下載
|
||||||
[Google Chrome](https://www.google.com/intl/en_pk/chrome/) 或 [Opera](https://www.opera.com/download) 或 [Edge](https://www.microsoft.com/en-us/edge) 或 [Firefox](https://www.mozilla.org/en-US/firefox/new/) 或 [Brave](https://www.brave.com/download/) 下載
|
|
||||||
|
[Google Chrome](https://www.google.com/intl/en_pk/chrome/) | [Opera](https://www.opera.com/download) | [Edge](https://www.microsoft.com/en-us/edge) | [Firefox](https://www.mozilla.org/en-US/firefox/new/) | [Brave](https://www.brave.com/download/)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -71,11 +71,11 @@ Always clean your browser's cache and cookies. If possible, use a VPN to create
|
|||||||
|
|
||||||
## 💻 System Support | 系統支持
|
## 💻 System Support | 系統支持
|
||||||
|
|
||||||
| Windows | x64 | ✅ | macOS | Intel | ✅ |
|
| Operating System | Architecture | Supported |
|
||||||
|:-------:|:-----:|:-:|:-----:|:-------------:|:-:|
|
|------------------|-------------------|-----------|
|
||||||
| Windows | x86 | ✅ | macOS | Apple Silicon | ✅ |
|
| Windows | x64, x86 | ✅ |
|
||||||
| Linux | x64 | ✅ | Linux | x86 | ✅ |
|
| macOS | Intel, Apple Silicon | ✅ |
|
||||||
| Linux | ARM64 | ✅ | Linux | ARM64 | ✅ |
|
| Linux | x64, x86, ARM64 | ✅ |
|
||||||
|
|
||||||
## 👀 How to use | 如何使用
|
## 👀 How to use | 如何使用
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# oauth_auth.py
|
||||||
import os
|
import os
|
||||||
from colorama import Fore, Style, init
|
from colorama import Fore, Style, init
|
||||||
import time
|
import time
|
||||||
@ -30,7 +31,7 @@ class OAuthHandler:
|
|||||||
def __init__(self, translator=None, auth_type=None):
|
def __init__(self, translator=None, auth_type=None):
|
||||||
self.translator = translator
|
self.translator = translator
|
||||||
self.config = get_config(translator)
|
self.config = get_config(translator)
|
||||||
self.auth_type = auth_type # make sure the auth_type is not None
|
self.auth_type = auth_type
|
||||||
os.environ['BROWSER_HEADLESS'] = 'False'
|
os.environ['BROWSER_HEADLESS'] = 'False'
|
||||||
self.browser = None
|
self.browser = None
|
||||||
self.selected_profile = None
|
self.selected_profile = None
|
||||||
@ -182,7 +183,7 @@ class OAuthHandler:
|
|||||||
f"{self.translator.get('oauth.supported_browsers', platform=platform_name)}\n" +
|
f"{self.translator.get('oauth.supported_browsers', platform=platform_name)}\n" +
|
||||||
"- Windows: Google Chrome, Chromium\n" +
|
"- Windows: Google Chrome, Chromium\n" +
|
||||||
"- macOS: Google Chrome, Chromium\n" +
|
"- macOS: Google Chrome, Chromium\n" +
|
||||||
"- Linux: Google Chrome, Chromium, chromium-browser"
|
"- Linux: Google Chrome, Chromium, google-chrome-stable"
|
||||||
)
|
)
|
||||||
raise Exception(error_msg)
|
raise Exception(error_msg)
|
||||||
|
|
||||||
@ -244,7 +245,7 @@ class OAuthHandler:
|
|||||||
browser_processes = {
|
browser_processes = {
|
||||||
'chrome': {
|
'chrome': {
|
||||||
'win': ['chrome.exe', 'chromium.exe'],
|
'win': ['chrome.exe', 'chromium.exe'],
|
||||||
'linux': ['chrome', 'chromium', 'chromium-browser'],
|
'linux': ['chrome', 'chromium', 'chromium-browser', 'google-chrome-stable'],
|
||||||
'mac': ['Chrome', 'Chromium']
|
'mac': ['Chrome', 'Chromium']
|
||||||
},
|
},
|
||||||
'brave': {
|
'brave': {
|
||||||
@ -428,7 +429,12 @@ class OAuthHandler:
|
|||||||
elif browser_type == 'firefox':
|
elif browser_type == 'firefox':
|
||||||
possible_paths = ['/usr/bin/firefox']
|
possible_paths = ['/usr/bin/firefox']
|
||||||
else: # 默认为 Chrome
|
else: # 默认为 Chrome
|
||||||
possible_paths = ['/usr/bin/google-chrome', '/usr/bin/google-chrome-stable', '/usr/bin/chromium', '/usr/bin/chromium-browser']
|
possible_paths = [
|
||||||
|
'/usr/bin/google-chrome-stable', # 优先检查 google-chrome-stable
|
||||||
|
'/usr/bin/google-chrome',
|
||||||
|
'/usr/bin/chromium',
|
||||||
|
'/usr/bin/chromium-browser'
|
||||||
|
]
|
||||||
|
|
||||||
# 检查每个可能的路径
|
# 检查每个可能的路径
|
||||||
for path in possible_paths:
|
for path in possible_paths:
|
||||||
@ -436,7 +442,7 @@ class OAuthHandler:
|
|||||||
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {self.translator.get('oauth.found_browser_at', path=path) if self.translator else f'Found browser at: {path}'}{Style.RESET_ALL}")
|
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {self.translator.get('oauth.found_browser_at', path=path) if self.translator else f'Found browser at: {path}'}{Style.RESET_ALL}")
|
||||||
return path
|
return path
|
||||||
|
|
||||||
# 如果找不到指定浏览器,则尝试使用Chrome
|
# 如果找不到指定浏览器,则尝试使用 Chrome
|
||||||
if browser_type != 'chrome':
|
if browser_type != 'chrome':
|
||||||
print(f"{Fore.YELLOW}{EMOJI['WARNING']} {self.translator.get('oauth.browser_not_found_trying_chrome', browser=browser_type) if self.translator else f'Could not find {browser_type}, trying Chrome instead'}{Style.RESET_ALL}")
|
print(f"{Fore.YELLOW}{EMOJI['WARNING']} {self.translator.get('oauth.browser_not_found_trying_chrome', browser=browser_type) if self.translator else f'Could not find {browser_type}, trying Chrome instead'}{Style.RESET_ALL}")
|
||||||
return self._get_chrome_path()
|
return self._get_chrome_path()
|
||||||
@ -447,29 +453,6 @@ class OAuthHandler:
|
|||||||
print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('oauth.error_finding_browser_path', error=str(e)) if self.translator else f'Error finding browser path: {e}'}{Style.RESET_ALL}")
|
print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('oauth.error_finding_browser_path', error=str(e)) if self.translator else f'Error finding browser path: {e}'}{Style.RESET_ALL}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _get_chrome_path(self):
|
|
||||||
"""Fallback method to get Chrome path"""
|
|
||||||
try:
|
|
||||||
if os.name == 'nt': # Windows
|
|
||||||
possible_paths = [
|
|
||||||
os.path.join(os.environ.get('PROGRAMFILES', ''), 'Google', 'Chrome', 'Application', 'chrome.exe'),
|
|
||||||
os.path.join(os.environ.get('PROGRAMFILES(X86)', ''), 'Google', 'Chrome', 'Application', 'chrome.exe'),
|
|
||||||
os.path.join(os.environ.get('LOCALAPPDATA', ''), 'Google', 'Chrome', 'Application', 'chrome.exe')
|
|
||||||
]
|
|
||||||
elif sys.platform == 'darwin': # macOS
|
|
||||||
possible_paths = ['/Applications/Google Chrome.app/Contents/MacOS/Google Chrome']
|
|
||||||
else: # Linux
|
|
||||||
possible_paths = ['/usr/bin/google-chrome', '/usr/bin/google-chrome-stable', '/usr/bin/chromium', '/usr/bin/chromium-browser']
|
|
||||||
|
|
||||||
for path in possible_paths:
|
|
||||||
if os.path.exists(path):
|
|
||||||
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {self.translator.get('oauth.found_chrome_at', path=path) if self.translator else f'Found Chrome at: {path}'}{Style.RESET_ALL}")
|
|
||||||
return path
|
|
||||||
return None
|
|
||||||
except Exception as e:
|
|
||||||
print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('oauth.error_finding_chrome_path', error=str(e)) if self.translator else f'Error finding Chrome path: {e}'}{Style.RESET_ALL}")
|
|
||||||
return None
|
|
||||||
|
|
||||||
def _configure_browser_options(self, browser_path, user_data_dir, active_profile):
|
def _configure_browser_options(self, browser_path, user_data_dir, active_profile):
|
||||||
"""Configure browser options based on platform"""
|
"""Configure browser options based on platform"""
|
||||||
try:
|
try:
|
||||||
@ -481,6 +464,7 @@ class OAuthHandler:
|
|||||||
co.set_argument('--no-first-run')
|
co.set_argument('--no-first-run')
|
||||||
co.set_argument('--no-default-browser-check')
|
co.set_argument('--no-default-browser-check')
|
||||||
co.set_argument('--disable-gpu')
|
co.set_argument('--disable-gpu')
|
||||||
|
co.set_argument('--remote-debugging-port=9222') # 明确指定调试端口
|
||||||
|
|
||||||
# Platform-specific options
|
# Platform-specific options
|
||||||
if sys.platform.startswith('linux'):
|
if sys.platform.startswith('linux'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user