Skip to main content

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.9.6.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

git2gitee-0.9.6-py3.6.egg (20.1 kB view details)

Uploaded Source

File details

Details for the file git2gitee-0.9.6.tar.gz.

File metadata

  • Download URL: git2gitee-0.9.6.tar.gz
  • Upload date:
  • Size: 5.3 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

Hashes for git2gitee-0.9.6.tar.gz
Algorithm Hash digest
SHA256 231b3df793f0d4e410e5722a9037db9f3b654151d109afc4fe637c88d53c1be0
MD5 cb582a248f31f1fda53141e047d2a089
BLAKE2b-256 dded2023fdd786db213fd80f4460e130d36cebb2864077dcb43a38071d98f027

See more details on using hashes here.

File details

Details for the file git2gitee-0.9.6-py3.6.egg.

File metadata

  • Download URL: git2gitee-0.9.6-py3.6.egg
  • Upload date:
  • Size: 20.1 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

Hashes for git2gitee-0.9.6-py3.6.egg
Algorithm Hash digest
SHA256 3f569e755395a7edf2a3c80f8aa57619f7a023af2093ca4fb90f48dcb7b790a4
MD5 934ab46b52af1b4ac44ed2b0ef9ed7ab
BLAKE2b-256 f9bac65362c2b10d1c37a7d468dfc89180c947c09b5bb10eadd66ede50e83194

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page