{"id":17742949,"url":"https://github.com/iktakahiro/youtube-url-parser","last_synced_at":"2025-04-01T16:30:45.166Z","repository":{"id":57118192,"uuid":"106378041","full_name":"iktakahiro/youtube-url-parser","owner":"iktakahiro","description":"Parser for Youtube URL","archived":false,"fork":false,"pushed_at":"2018-08-29T04:14:30.000Z","size":73,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-18T00:09:51.597Z","etag":null,"topics":["javascript","nodejs","typescript","url-parser"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/iktakahiro.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":"2017-10-10T06:38:12.000Z","updated_at":"2023-09-08T17:30:59.000Z","dependencies_parsed_at":"2022-08-23T04:40:17.591Z","dependency_job_id":null,"html_url":"https://github.com/iktakahiro/youtube-url-parser","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktakahiro%2Fyoutube-url-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktakahiro%2Fyoutube-url-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktakahiro%2Fyoutube-url-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktakahiro%2Fyoutube-url-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iktakahiro","download_url":"https://codeload.github.com/iktakahiro/youtube-url-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620331,"owners_count":20806754,"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":["javascript","nodejs","typescript","url-parser"],"created_at":"2024-10-26T05:42:10.659Z","updated_at":"2025-04-01T16:30:44.931Z","avatar_url":"https://github.com/iktakahiro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# youtube-url-parser\n\n[![Build Status](https://travis-ci.org/iktakahiro/youtube-url-parser.svg?branch=master)](https://travis-ci.org/iktakahiro/youtube-url-parser)\n\n## Install\n\n```bash\nnpm install @iktakahiro/youtube-url-parser\n```\n\n## How to use\n\n```typescript\nimport { YouTubeURLParser } from \"@iktakahiro/youtube-url-parser\"\n\nconst parser = new YouTubeURLParser(\"https://youtu.be/7lmCu8wz8ro?t=2m10s\")\n\nconsole.log(parser.isValid())\n// -\u003e true\nconsole.log(parser.getId())\n// -\u003e \"7lmCu8wz8ro\"\nconsole.log(parser.getCanonicalURL())\n// -\u003e \"https://www.youtube.com/watch?v=7lmCu8wz8ro\u0026t=2m10s\"\nconsole.log(parser.getShortURL())\n// -\u003e \"https://youtu.be/7lmCu8wz8ro\u0026t=2m10s\"\nconsole.log(parser.getThumbnailURL())\n// -\u003e \"https://img.youtube.com/vi/7lmCu8wz8ro/0.jpg\"\nconsole.log(parser.getStartAtSecond())\n// -\u003e 130 (2m * 60s + 10s)\n```\n\n`getIframe()`:\n\n```js\nconsole.log(parser.getIframe())\n```\n\n`getIframe()` method returns HTML strings containing an iframe element for embedding.\n\n```html\n\u003cdiv class=\"embed-responsive embed-responsive-16by9\"\u003e\n\u003ciframe\n   class=\"embed-responsive-item\" type=\"text/html\"\n   src=\"https://www.youtube.com/embed/7lmCu8wz8ro?rel=0\u0026amp;start=4830\"\n   frameborder=\"0\" allowfullscreen\u003e\u003c/iframe\u003e\n\u003c/div\u003e\n```\n\nwith options:\n\n```js\nconst options = {\n  allowFullScreen: false,\n  frameBorder: 1,\n  noCookie: true,\n}\nconsole.log(parser.getIframe(options))\n```\n\nWhen the params is set, the following HTML strings are returned.\n\n```html\n\u003cdiv class=\"embed-responsive embed-responsive-16by9\"\u003e\n\u003ciframe\n   class=\"embed-responsive-item\" type=\"text/html\"\n   src=\"https://www.youtube-nocookie.com/embed/7lmCu8wz8ro?rel=0\u0026amp;start=4830\"\n   frameborder=\"1\"\u003e\u003c/iframe\u003e\n\u003c/div\u003e\n```\n\n## Test\n\n```bash\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiktakahiro%2Fyoutube-url-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiktakahiro%2Fyoutube-url-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiktakahiro%2Fyoutube-url-parser/lists"}