{"id":21031964,"url":"https://github.com/navid2zp/idm","last_synced_at":"2025-05-15T12:31:26.702Z","repository":{"id":57560826,"uuid":"296027139","full_name":"Navid2zp/idm","owner":"Navid2zp","description":"Golang wrapper for Internet Download Manager (IDM) CLI.","archived":false,"fork":false,"pushed_at":"2020-09-16T13:17:13.000Z","size":9,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T09:12:15.214Z","etag":null,"topics":["download-manager","downloader","downloadmanager","go","golang","idm","internet-download-manager"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Navid2zp.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":"2020-09-16T12:33:59.000Z","updated_at":"2024-10-13T12:50:41.000Z","dependencies_parsed_at":"2022-09-01T12:21:13.997Z","dependency_job_id":null,"html_url":"https://github.com/Navid2zp/idm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Navid2zp%2Fidm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Navid2zp%2Fidm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Navid2zp%2Fidm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Navid2zp%2Fidm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Navid2zp","download_url":"https://codeload.github.com/Navid2zp/idm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254341127,"owners_count":22054983,"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":["download-manager","downloader","downloadmanager","go","golang","idm","internet-download-manager"],"created_at":"2024-11-19T12:39:16.495Z","updated_at":"2025-05-15T12:31:25.290Z","avatar_url":"https://github.com/Navid2zp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# idm\nGolang wrapper for Internet Download Manager (IDM) CLI.\n\n### Install\n\nTo use in a go project:\n```\ngo get github.com/Navid2zp/idm\n```\n\n### Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Navid2zp/idm\"\n\t\"time\"\n)\n\nfunc main() {\n\tdownload, _ := idm.NewDownload(\"https://codeload.github.com/Navid2zp/idm/zip/master\")\n\t// Silent mode and quit after finish\n\tdownload.Silent().QuitAfterFinish()\n\t// set download path\n\tdownload.SetFilePath(\"C:\")\n\t// Start the download\n\t_ = download.Start()\n\n\t// Wait till file is appeared in the given path\n\terr := download.VerifyDownload(time.Second * 10)\n\tif err != nil {\n\t\tfmt.Println(\"couldn't verify file download:\", err.Error())\n\t}\n}\n```\n\n#### Parameters\nCheck out the IDM methods here: https://www.internetdownloadmanager.com/support/command_line.html\n\n```go\n// Turns on the silent mode when IDM doesn't ask any questions\ndownload.Silent()\n\n// IDM will hang up your connection after the successful downloading\ndownload.HangUpAfterFinish()\n\n// IDM will exit after the successful downloading.\n// This parameter works only for the first copy\ndownload.QuitAfterFinish()\n\n// Defines the local path where to save the file\ndownload.SetFilePath(\"C:/Users/MyPC/Downloads\")\n\n// Defines local file name to save the file\ndownload.SetFileName(\"myFile.zip\")\n\n// adds specified file to download queue, but don't start downloading\ndownload.AddToQueue()\n```\n\n**Starting the main IDM queue:**\n\n```go\nerr := idm.StartMainQueue()\n```\n\n##### Verify IDM installation\n\n```go\ninstalled, _ := idm.VerifyIDM()\n\nif !installed {\n    fmt.Println(\"Couldn't find IDM\")\n} else {\n    fmt.Println(\"IDM found\")\n}\n```\n\nThis package uses [go-win64api][1]'s `InstalledSoftwareList` method to list all the installed applications and checks if IDM is present. Then it will try to find it's path. It fails to verify IDM if `IDMan.exe` won't be present in the same directory as `Uninstall.exe`\n\nYou can set the IDM path manually:\n\n```go\nidm.SetIDMPath(\"path/to/idm.exe\")\n```\n\n\n##### Verify download\n\nThere is no way to be sure if a download is completed or not since we can't actually control the IDM. The closest way to check if a download is finished is by checking the download path and look for the file.\n\n```go\nerr := download.VerifyDownload(time.second * 30)\n```\n\n**NOTE:** You have to specify download path using `SetFilePath` method to use this option. Also I recommend setting the file name using `SetFileName` method to make sure that we know where the file is to verify it.\n\nIf filename isn't specified, program will try to find it from URL header which might not be available or be different than what IDM chooses causing this method to fail the verification.\n\n\nLicense\n----\n\n[MIT][2]\n\n[1]: https://github.com/iamacarpet/go-win64api\n[2]: https://github.com/Navid2zp/idm/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavid2zp%2Fidm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavid2zp%2Fidm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavid2zp%2Fidm/lists"}