{"id":22291287,"url":"https://github.com/maestroerror/wget-download","last_synced_at":"2025-07-06T01:34:23.800Z","repository":{"id":62521731,"uuid":"383833093","full_name":"MaestroError/wget-download","owner":"MaestroError","description":"easy to use, chainable PHP class for downloading files, uses wget CLI","archived":false,"fork":false,"pushed_at":"2022-09-11T16:12:15.000Z","size":178,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-30T18:51:22.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaestroError.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}},"created_at":"2021-07-07T14:49:34.000Z","updated_at":"2022-10-05T17:42:10.000Z","dependencies_parsed_at":"2022-11-02T14:00:33.825Z","dependency_job_id":null,"html_url":"https://github.com/MaestroError/wget-download","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaestroError%2Fwget-download","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaestroError%2Fwget-download/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaestroError%2Fwget-download/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaestroError%2Fwget-download/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaestroError","download_url":"https://codeload.github.com/MaestroError/wget-download/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245550588,"owners_count":20633871,"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","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":[],"created_at":"2024-12-03T17:16:31.481Z","updated_at":"2025-03-25T21:42:57.114Z","avatar_url":"https://github.com/MaestroError.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wget-download\neasy to use, chainable PHP class for downloading files, uses **wget** CLI\n\n# Docs\nI will try to provide some instructions, to better understand and use the main features of this little library.   \n\n- [Installation](#installation)\n    - [Composer](#via-composer)\n    - [From github](#from-github)\n- [Initialization](#initialization-of-class-construction)\n- [Options](#Options)\n- [Logs](#logs)\n- [Run](#run)\n\n## installation\n#### via Composer:  \n```\ncomposer require maestroerror/wget-download  \n```\n*Don't forget to require autoload.php file*   \n#### from github:\n```\ngit clone https://github.com/MaestroError/wget-download.git\n```\n        \n*Note: It needs **wget** command to be available from your terminal. Check with `wget --help` or install: Run `apt-get install wget` for linux or [download for windows](https://eternallybored.org/misc/wget/)*\n\n## Initialization of class (Construction)\nYou can construct object with 3 different ways: with array of configs, with string of URL or without any parameters (and provide them further). Which you choose, it depends on your needs:\n```\n// Construct with parameteres array\n$conf = [\n    \"filename\" =\u003e \"/Home/Downloads/newFileName.mp4\",\n    \"folder\" =\u003e \"YOUR FOLDER\",\n    \"url\" =\u003e \"YOUR URL\"\n];\n$file = new maestroerror\\wgd($conf);\n\n// Construct with URL only\n$url = \"YOUR URL\";\n$file = new maestroerror\\wgd($url);\n\n// Construct without parameters\n$file = new maestroerror\\wgd();\n$file-\u003efolder(\"YOUR FOLDER\")-\u003ename(\"/Home/Downloads/newFileName.mp4\")-\u003eurl(\"YOUR URL\");\n```\n## Options\nset speed limit:\n```\n$file-\u003espeedLimit(\"500k\");\n```\nenable continue after the interrupt, so if the internet connection stopped it will automatically resume the download after the connection is restored:\n```\n$file-\u003econtinueIfStopped();\n```\n**$checkCertificate** is defined in wgd class as protected boolean property and by default it is set to *false*, you can use *secure* method, to allow **HTTPS** certificate check for specific downloads:\n```\n$file-\u003esecure();\n```\nBy default silent (download in background) mode is enabled, but for some specific downloads you can specify conditions:\n```\n$file-\u003esilent();\n$file-\u003ewait(); // Waits before downloaded\n```\nSometimes you should use a user agent for download. first, you need to allow and after set user agent for your download:\n```\n$file-\u003eallowUserAgent()-\u003euserAgent($user_agent_string)\n```\nfor multiple .txt downloads, you need .txt file with urls (line by line). Like in user agent case, first, allow multiple download with *multiple* method and then give .txt file to run:\n```\n$file-\u003emultiple()-\u003efile($filepath);\n```\n## Logs\ndefault log file is defined as protected property in wgd class `protected string $logFile = \"wgetlog.txt\";`, but if you need, you can specify with *setLog* method:\n```\n$file-\u003esetLog(\"/Home/Downloads/newFileLog.txt\");\n$file-\u003esetLog(\"newFileLog.txt\");\n```\n## Run\nThe last step is an execution, you can start your download with *run* method: `$file-\u003erun()`.    \nNow let's say, we need to download file on background, with secure connection, set speed limit 1MB and allow continue:\n```\n$conf = [\n    \"filename\" =\u003e \"/Home/Downloads/newFileName.mp4\",\n    \"folder\" =\u003e \"YOUR FOLDER\",\n    \"url\" =\u003e \"YOUR URL\"\n];\n$file = new maestroerror\\wgd($conf);\n$file-\u003esetLog(\"newFileLog.txt\")-\u003esilent()-\u003esecure()-\u003espeedLimit(\"1m\")-\u003econtinueIfStopped()-\u003erun()\n```\n\n---------------------------------      \n### To Do\n- Search for todo comments and fix them\n- Add more use cases in examples\n- Add config files\n- Update documentation\n- New release","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaestroerror%2Fwget-download","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaestroerror%2Fwget-download","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaestroerror%2Fwget-download/lists"}