{"id":20434605,"url":"https://github.com/arstgit/videox","last_synced_at":"2025-07-21T09:05:44.597Z","repository":{"id":57392338,"uuid":"300489747","full_name":"arstgit/videox","owner":"arstgit","description":"Download HTML5 videos from a website page.","archived":false,"fork":false,"pushed_at":"2020-10-08T22:58:09.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T08:43:10.486Z","etag":null,"topics":["mediasource-extensions"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/arstgit.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-10-02T03:23:52.000Z","updated_at":"2021-07-15T07:40:53.000Z","dependencies_parsed_at":"2022-09-01T16:01:55.520Z","dependency_job_id":null,"html_url":"https://github.com/arstgit/videox","commit_stats":null,"previous_names":["derekchuank/videox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arstgit/videox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arstgit%2Fvideox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arstgit%2Fvideox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arstgit%2Fvideox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arstgit%2Fvideox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arstgit","download_url":"https://codeload.github.com/arstgit/videox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arstgit%2Fvideox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266270467,"owners_count":23902734,"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":["mediasource-extensions"],"created_at":"2024-11-15T08:27:53.764Z","updated_at":"2025-07-21T09:05:44.580Z","avatar_url":"https://github.com/arstgit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# videox\n\nDownload HTML5 videos from a website page using Media Source Extensions (MSE).\n\nNote: \n\n1. videox is designed for pages using Media Source Extensions (MSE) technique. For pages using other techniques, just embed a HTTP URL into video tag, for example, videox will throw an error.\n2. Some pages have video ads using the same technique as the actual video content, the MSE. videox can't distingush them, it just downloads all video ads and the actual video by default. The easiest way to deal with this is using a browser with ads block extension. Alternatively you can modify this program as you need as it's just a web crawler based on puppeteer.\n\n# Prerequisites\n\n- chrome. Needed if the websites were providing MP4 video you wanted that is usually the case. Otherwise chromium, puppeteer downloaded automatically is enough.\n\n# Design\n\n[https://www.tiaoxingyubolang.com/zh/article/2020-10-09_mediasource](https://www.tiaoxingyubolang.com/zh/article/2020-10-09_mediasource)\n\n# Usage\n\n```js\nconst Videox = require('videox')\n\nconst targetUrl = 'https://www.youtube.com/watch?v=h32FxBqmu_U'\n\n(async () = {\n  const videox = new Videox({\n    debug: true,\n    headless: true,\n    downloadBrowser: false,\n    logTo: process.stdout,\n    browserExecutePath: '/usr/bin/chromium',\n    browserArgs: ['--no-sandbox'],\n    downloadAsFile: true,\n    downloadPath: path.join(__dirname, 'download'),\n    checkCompleteLoopInterval: 100,\n    waitForNextDataTimeout: 8000,\n  })\n\n  await videox.init()\n\n  await videox.get(targetUrl)\n\n  await videox.destroy()\n})()\n```\n\n# API\n\n## Class: Videox\n\n### Event: 'data'\n\n- `objectURL` \\\u003cstring\u003e The URL created from `URL.createObjectURL`, usually starts with `blob`.\n- `mimeCodec` \\\u003cstring\u003e Corresponding mimeCodec.\n- `chunk` \\\u003cBuffer\u003e The data received from page.\n\nIf `options.downloadAsFile` is specified as `false`, this event must be listened for receiving media data.\n\n`objectURL` and `mimeCode` together identify a media file to which `chunk` corresponding.\n\n### new Videox([options])\n\n- `options` \\\u003cobject\u003e\n    - `debug` \\\u003cbool\u003e Default: false.\n    - `headless` \\\u003cbool\u003e Default: true.\n    - `downloadBrowser` \\\u003cbool\u003e Default: false.\n    - `logTo` \\\u003cWritable\u003e Default: process.stdout.\n    - `browserExecutePath`: \\\u003cstring\u003e Default: '/usr/bin/chromium'.\n    - `browserArgs`: \\\u003carray\u003e: Default: [].\n    - `downloadAsFile` \\\u003cbool\u003e Default: true.\n    - `dowloadPath` \\\u003cstring\u003e Default: ''.\n    - `checkCompleteLoopInterval` \\\u003cnumber\u003e The time interval  between checking whether  current download progress is commplete, in milliseconds. Default: 100,\n    - `waitForNextDataTimeout`: \\\u003cnumber\u003e The timeout waiting for next media data, in milliseconds. Default: 3000.\n- `Returns`: \\\u003cVideox\u003e\n\nUsually `dowloadBrowser` is false and `browserExecutePath` is filled with common browser path to download MP4 using browsers other than the default chromium. See `puppeteer` package for more information.\n\n### videox.init()\n\n- `Returns`: \\\u003cPromise\u003e\n\n### video.get(options)\n\n- `pageUrl` \\\u003cstring\u003e Required.\n- `Returns`: \\\u003cPromise\u003e\n\n### videox.destroy()\n\n- `Returns`: \\\u003cPromise\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farstgit%2Fvideox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farstgit%2Fvideox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farstgit%2Fvideox/lists"}