mfilippov / vimeo-dot-net

A .NET wrapper for Vimeo API v3.0
MIT License
98 stars 88 forks source link

Get the last parsable piece of the URL as the Id #191

Closed Robson-Rocha closed 1 year ago

Robson-Rocha commented 1 year ago

The ParseModelUriId method assumed that the last piece would always be the ID, but after the security change by Vimeo mentioned in https://help.vimeo.com/hc/en-us/articles/13741122177169-FAQ-Enhancing-the-security-of-Vimeo-embeds- a new alphanumeric part is being added to the Clip URI, which is not the ClipId, but the extra "h" parameter value.

The method was updated to look from the last piece to the first for the final piece that can be parsed as long, so the ClipId extra route part is ignored, and all other usages remain intact.

mfilippov commented 1 year ago

@Robson-Rocha Thank you for the contribution. Could you add you case into:

https://github.com/mfilippov/vimeo-dot-net/blob/master/src/VimeoDotNet.Tests/ModelHelpersTests.cs
mfilippov commented 1 year ago

I added tests in #193 and more proper fix also.