These are few readmes i found while searching for g.api.mega.co.nz so i can write a mega downloader.
-
-
Save CypherpunkSamurai/7b476aef9d42fc29fe8a904a91039e85 to your computer and use it in GitHub Desktop.
MEGA.nzmega.nz
We make secure cloud storage simple. Create an account and get 50 GB free on MEGA's end-to-end encrypted cloud collaboration platform today!
A script to download file from Mega.n and read it. (Using PHP)
- Get file details and information
- Download the file
- Read file and Decrypt it
step 1: make api call to mega api server get info about the file with download link api return filename,filesize,download link filename is encrypted string
step 2: we download the encrypted file using the url returned in step 1 api response
step 3: after download decrypt the file
https://mega.nz/#!GF9mCC5A!yrZMIgVlNok_wE6Vl2130sTJKOGTKgvxpPjSVOwVz1Y1
File ID: GF9mCC5A
File decrypt key: yrZMIgVlNok_wE6Vl2130sTJKOGTKgvxpPjSVOwVz1Y1
[0] => stdClass Object
(
[s] => 4
[at] => gELEbMQ0rg3kEyC9sUtlORwYuQ_Kp19OMXm0Ju-u_enARPeJSc0DleBpdw_GjBIcFt8YHP_Jr_-r2Q7kywUt0w
[msd] => 1
[tl] => 0
[g] => https://gfs270n062.userstorage.mega.co.nz/dl/NcL3FDKCLMnG7gLizKAJNyhehZe5cNgHTl5h0ceS0DHL8okSJCeRPnbvBWgz63oA1m-PTVG24rSrAK5U47pPuFcxMXbVvHpwXvSiuhUyfHnXvu9vI_pHLBYUZfsbJA
)
File link at top object is expired!
- at=attributes means contains filename etc
- s=size of file
- g=dl link
- at=file attributes it may contain other info also not only filename
File ID: GF9mCC5A
API URL: https://g.api.mega.co.nz/cs
curl -X POST -d '[{"a":"g","v":2,"p":"GF9mCC5A","ssl":2,"g":1}]' -v https://g.api.mega.co.nz/cs
Response:
* About to connect() to g.api.mega.co.nz port 443 (#0)
* Trying 31.216.147.135...
* Connected to g.api.mega.co.nz (31.216.147.135) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* subject: CN=*.api.mega.co.nz,OU=PremiumSSL Wildcard,O=Mega Limited,STREET="15, Pwc Tower, 188 Quay Street,",L=Auckland,ST=Auckland,postalCode=1010,C=NZ
* start date: Dec 11 00:00:00 2017 GMT
* expire date: Dec 10 23:59:59 2020 GMT
* common name: *.api.mega.co.nz
* issuer: CN=COMODO RSA Organization Validation Secure Server CA,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB
> POST /cs HTTP/1.1
> User-Agent: curl/7.29.0
> Host: g.api.mega.co.nz
> Accept: */*
> Content-Length: 46
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 46 out of 46 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: Content-Type, MEGA-Chrome-Antileak
< Access-Control-Expose-Headers: Original-Content-Length
< Access-Control-Max-Age: 86400
< Original-Content-Length: 296
< Content-Length: 296
< Connection: keep-alive
<
* Connection #0 to host g.api.mega.co.nz left intact
[{"s":4,"at":"gELEbMQ0rg3kEyC9sUtlORwYuQ_Kp19OMXm0Ju-u_enARPeJSc0DleBpdw_GjBIcFt8YHP_Jr_-r2Q7kywUt0w","msd":1,"tl":0,"g":"https://gfs270n062.userstorage.mega.co.nz/dl/_MNd6LXuuwPdJgIu2rQoEGaEeQBxvOiof03QMtKqbzrlny9BYGFfn9iaqMK2ubLMWbrNhFz11YEu1_Wdm7MAXXaKyu3__FA11XeCLrhQeh3LyIDdzN0EJIsOnrSbNw"}]
- libopenssl
- libsodium
- openssl_cipher_iv_length
- openssl_decrypt
- aes128_cbc_decrypt
- SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES
- sodium_crypto_secretbox_open
- sodium_crypto_secretstream_xchacha20poly1305_init_pull
My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)
A team includes some programmer, developer, designer, researcher(s) especially Max Base.
Nginx反向代理配置文件(不发送TLS SNI头),支持直连IP联通但是域名无法访问的情况。
局限性:不支持基于SNI分配证书的CDN,例如:Akamai、CloudFlare,不传输SNI无法获得证书从而无法通过IP直接连接(单IP多域名)。
git clone https://github.com/LittleJake/nginx-proxy-without-sni-conf/,拷贝conf.d、ca至Nginx配置文件目录;- 签发自签名证书,进入
ca目录依次执行sudo bash gen_ca_cert_key.sh、sudo bash bash gen_cert.sh,随便输入相关信息。 - 导入
FakeCA.crt到计算机/手机内; - 直接访问域名即可打开。
ps:后期添加域名后,执行sudo bash bash gen_cert.sh即可更新证书对应域名。
| 站点 | 域名 |
|---|---|
| Pixiv | i.pximg.net |
| pixiv.net | |
| ssl.pixiv.net | |
| accounts.pixiv.net | |
| touch.pixiv.net | |
| oauth.secure.pixiv.net | |
| www.pixiv.net | |
| sketch.pixiv.net | |
| app-api.pixiv.net | |
| imgaz.pixiv.net | |
| comic.pixiv.net | |
| novel.pixiv.net | |
| source.pixiv.net | |
| i1.pixiv.net | |
| i2.pixiv.net | |
| i3.pixiv.net | |
| i4.pixiv.net | |
| dic.pixiv.net | |
| en-dic.pixiv.net | |
| sensei.pixiv.net | |
| fanbox.pixiv.net | |
| payment.pixiv.net | |
| factory.pixiv.net | |
| *.pixivsketch.net | |
| *.pximg.net | |
| imp.pixiv.net | |
| Mega | mega.nz |
| g.api.mega.co.nz | |
| *.mega.nz | |
| Wikipedia | *.wikipedia.org |
| *.m.wikipedia.org | |
| wikimedia.org | |
| upload.wikimedia.org | |
| Steam | *.steamcommunity.com |
| steamcommunity.com | |
| *.steampowered.com | |
| steampowered.com | |
| Archive of Our Own | *.archiveofourown.org |
| archiveofourown.org |
| 站点 | 域名 |
|---|---|
| Nyaa | nyaa.si |
| www.nyaa.si | |
| sukebei.nyaa.si | |
| E-Hentai | forums.e-hentai.org |
| ExHentai | exhentai.org |
| *.exhentai.org |
配置文件思路参考:mashirozx/Pixiv-Nginx
- Python 3.5+
- pip install sys
- pip install requests
A basic tool that checks if a MEGA link is still online or not. Deletes the links that are offline if the '-d' argumet is given.
python mega.py "links.txt"
which simply lists if the links are online or not.
python mega.py -d "links.txt"
which lists if the links are online or not and deletes the offline ones from the original text file.
The path given can be an absolute path or a relative path.
Alternatively, you can check the status of a single link using:
sudo curl --silent --data-ascii '[{"a":"g", "g":1, "ssl":0, "p":"'CODE'"}]' https://eu.api.mega.co.nz/cs
where CODE is the unique id from your MEGA link (ex. ABcD1E2F for https://mega.nz/folder/ABcD1E2F#WSv_Y1PWjQs1QbYBbyhjfw)

