jsVideoUrlParser icon indicating copy to clipboard operation
jsVideoUrlParser copied to clipboard

Support unlisted vimeo urls with parameters

Open JannikApm opened this issue 2 years ago • 0 comments

Unlisted Vimeo links consist of the video ID and an additional hash: https://vimeo.com/[video_id]/[unlisted_hash]. More information about unlisted Vimeo links can be found here.

The problematic links I'm encountering are unlisted links with an additional URL parameter. Those are created when simply pressing the "share" button on an unlisted video's player.

Parsing the following link https://vimeo.com/12345678/abcdefg?share=copy returns

{
  "mediaType": "video",
  "params": {
    "share": "copy"
  },
  "id": "12345678",
  "provider": "vimeo"
}

While parsing https://vimeo.com/12345678/abcdefg returns

{
  "mediaType": "video",
  "params": {
    "hash": "abcdefg"
  },
  "id": "12345678",
  "provider": "vimeo"
}

Solution: URL param and hash should probably be merged so that both are kept.

Expected return for https://vimeo.com/12345678/abcdefg?share=copy

{
  "mediaType": "video",
  "params": {
    "hash": "abcdefg",
    "share": "copy"
  },
  "id": "12345678",
  "provider": "vimeo"
}

JannikApm avatar Nov 01 '23 14:11 JannikApm