{"id":25171510,"url":"https://github.com/basemax/megadownloader","last_synced_at":"2025-09-03T15:37:52.777Z","repository":{"id":151535447,"uuid":"242536971","full_name":"BaseMax/MegaDownloader","owner":"BaseMax","description":"A script to download file from Mega.n and read it. (Using PHP)","archived":false,"fork":false,"pushed_at":"2020-02-23T15:14:15.000Z","size":33,"stargazers_count":23,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-29T23:48:19.596Z","etag":null,"topics":["mega","mega-download","mega-download-script","mega-downloader","mega-downloader-script","mega-drive","megadrive","script-mega","script-mega-downloader"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-02-23T15:00:25.000Z","updated_at":"2024-08-04T04:15:18.000Z","dependencies_parsed_at":"2023-07-10T14:00:52.833Z","dependency_job_id":null,"html_url":"https://github.com/BaseMax/MegaDownloader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaseMax/MegaDownloader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FMegaDownloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FMegaDownloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FMegaDownloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FMegaDownloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/MegaDownloader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FMegaDownloader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273467252,"owners_count":25111129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mega","mega-download","mega-download-script","mega-downloader","mega-downloader-script","mega-drive","megadrive","script-mega","script-mega-downloader"],"created_at":"2025-02-09T09:20:42.564Z","updated_at":"2025-09-03T15:37:52.769Z","avatar_url":"https://github.com/BaseMax.png","language":"PHP","readme":"# MEGA Downloader\n\nMEGA.nzmega.nz\n\nWe make secure cloud storage simple. Create an account and get 50 GB free on MEGA's end-to-end encrypted cloud collaboration platform today!\n\n\n# Mega.n Downloader Script\n\nA script to download file from Mega.n and read it. (Using PHP)\n\n## Features\n\n- Get file details and information\n- Download the file\n- Read file and Decrypt it\n\n## Tasks\n\n**step 1:**\nmake api call to mega api server get info about the file with download link\napi return filename,filesize,download link\nfilename is encrypted string\n\n**step 2:**\nwe download the encrypted file using the url returned in step 1 api response\n\n**step 3:**\nafter download decrypt the file\n\n## Sample MEGA Link\n\nhttps://mega.nz/#!GF9mCC5A!yrZMIgVlNok_wE6Vl2130sTJKOGTKgvxpPjSVOwVz1Y1\n\n**File ID:** GF9mCC5A\n\n**File decrypt key:** yrZMIgVlNok_wE6Vl2130sTJKOGTKgvxpPjSVOwVz1Y1\n\n### Sample API Response\n\n```\n[0] =\u003e stdClass Object\n(\n    [s] =\u003e 4\n    [at] =\u003e gELEbMQ0rg3kEyC9sUtlORwYuQ_Kp19OMXm0Ju-u_enARPeJSc0DleBpdw_GjBIcFt8YHP_Jr_-r2Q7kywUt0w\n    [msd] =\u003e 1\n    [tl] =\u003e 0\n    [g] =\u003e https://gfs270n062.userstorage.mega.co.nz/dl/NcL3FDKCLMnG7gLizKAJNyhehZe5cNgHTl5h0ceS0DHL8okSJCeRPnbvBWgz63oA1m-PTVG24rSrAK5U47pPuFcxMXbVvHpwXvSiuhUyfHnXvu9vI_pHLBYUZfsbJA\n)\n```\n\nFile link at top object is expired!\n\n## MEGA API Structure\n\n- at=attributes means contains filename etc\n- s=size of file\n- g=dl link\n- at=file attributes it may contain other info also not only filename\n\n## Call API Using CURL\n\n**File ID:** GF9mCC5A\n\n**API URL:** https://g.api.mega.co.nz/cs\n\n```\ncurl -X POST -d '[{\"a\":\"g\",\"v\":2,\"p\":\"GF9mCC5A\",\"ssl\":2,\"g\":1}]'  -v https://g.api.mega.co.nz/cs\n```\n\nResponse:\n\n```\n* About to connect() to g.api.mega.co.nz port 443 (#0)\n*   Trying 31.216.147.135...\n* Connected to g.api.mega.co.nz (31.216.147.135) port 443 (#0)\n* Initializing NSS with certpath: sql:/etc/pki/nssdb\n*   CAfile: /etc/pki/tls/certs/ca-bundle.crt\n  CApath: none\n* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n* Server certificate:\n* \tsubject: 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\n* \tstart date: Dec 11 00:00:00 2017 GMT\n* \texpire date: Dec 10 23:59:59 2020 GMT\n* \tcommon name: *.api.mega.co.nz\n* \tissuer: CN=COMODO RSA Organization Validation Secure Server CA,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB\n\u003e POST /cs HTTP/1.1\n\u003e User-Agent: curl/7.29.0\n\u003e Host: g.api.mega.co.nz\n\u003e Accept: */*\n\u003e Content-Length: 46\n\u003e Content-Type: application/x-www-form-urlencoded\n\u003e \n* upload completely sent off: 46 out of 46 bytes\n\u003c HTTP/1.1 200 OK\n\u003c Content-Type: application/json\n\u003c Access-Control-Allow-Origin: *\n\u003c Access-Control-Allow-Headers: Content-Type, MEGA-Chrome-Antileak\n\u003c Access-Control-Expose-Headers: Original-Content-Length\n\u003c Access-Control-Max-Age: 86400\n\u003c Original-Content-Length: 296\n\u003c Content-Length: 296\n\u003c Connection: keep-alive\n\u003c \n* Connection #0 to host g.api.mega.co.nz left intact\n[{\"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\"}]\n```\n\n## Tools\n\n- libopenssl\n- libsodium\n\n## Help\n\n### OpenSSL\n\n- openssl_cipher_iv_length\n- openssl_decrypt\n- aes128_cbc_decrypt\n\n### Sodium\n\n- SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES\n- sodium_crypto_secretbox_open\n- sodium_crypto_secretstream_xchacha20poly1305_init_pull\n\n---------\n\n# Max Base\n\nMy nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. ([Max Base](https://maxbase.org/))\n\n## Asrez Team\n\nA team includes some programmer, developer, designer, researcher(s) especially Max Base.\n\n[Asrez Team](https://www.asrez.com/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fmegadownloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fmegadownloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fmegadownloader/lists"}