import github repo to gitee, then clone to local
Project description
git2gitee
从github导入仓库到gitee 解决github下载速度慢的问题 由于码云不提供导入的api,只能JS逆向码云登陆,导入仓库
安装
pip install git2gitee
使用
# git2gitee -u {gitee_username} -k {gitee_password} github_repo_url
git2gitee -u mikele -k password https://github.com/toyourheart163/git2gitee
加密方法
进入登陆页面时会加载一个encrypt开头的js文件
python 使用公钥加密的方法, 使用pycryptodome
# git2gitee/util.py
from base64 import b64encode
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
def encrypt_pwd(password, public_key):
rsa_key = RSA.import_key(public_key)
encryptor = PKCS1_v1_5.new(rsa_key)
cipher = b64encode(encryptor.encrypt(password.encode('utf-8')))
return cipher.decode('utf-8')
解决csrf-token 的问题
import re
result = re.search('<meta content="(.*?)" name="csrf-token"', response.text)
token = result.group(1)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
git2gitee-0.0.5.tar.gz
(4.8 kB
view details)
Built Distribution
git2gitee-0.0.5-py3.6.egg
(18.6 kB
view details)
File details
Details for the file git2gitee-0.0.5.tar.gz
.
File metadata
- Download URL: git2gitee-0.0.5.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81873263cb7eef9f1719609ee6bb5a0dc9871d2bca4d55c23986456d488cfdb3 |
|
MD5 | 894e4225ee6b6233b8a1dde54254d17e |
|
BLAKE2b-256 | 31c27f0850ecb24a77418852ee7e9da6a9e55b0388a00063eae8e23329609657 |
File details
Details for the file git2gitee-0.0.5-py3.6.egg
.
File metadata
- Download URL: git2gitee-0.0.5-py3.6.egg
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e8245d7c45e9c0680b3d04022fccb79639a9c4918c6994ad81efe63a273567a |
|
MD5 | e5e53791d9d026f0e054606db7e6451f |
|
BLAKE2b-256 | fabb65b064465655c5d1ba7a320a53374cd544f9ddbe7af6e27e5bac300e5bf1 |