vimeo

package
v1.55.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: OSL-3.0 Imports: 8 Imported by: 2

README

Vimeo

Android client

Requires SDK version 26

Parse URL

We have to write our own URL parser, since the current ones dont work in all cases. This URL fails with first parser:

GET /api/oembed.json?url=https://vimeo.com/477957994?unlisted_hash=2282452868
Host: vimeo.com

and second parser:

GET /videos?links=https://vimeo.com/477957994?unlisted_hash=2282452868 HTTP/1.1
Host: api.vimeo.com
Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NDQ1MzIzMj...

files

If we use the Vimeo URL:

https://player.vimeo.com/video/322402891/config?token=eyJhbGciOiJIUzI1NiJ9.ey...

we get direct links to videos:

https://vod-progressive.akamaized.net/exp=1659985751~acl=%2Fvimeo-prod-skyfir...

If we use the VHX URL:

https://api.vhx.tv/videos/17901

we then have to request again:

https://api.vhx.tv/videos/17901/files

before getting the direct link:

https://gcs-vimeo.akamaized.net/exp=1659999606acl=%2A%2F1253374903.mp4%2Ahm...

videos

pass:

GET /videos/17901?vimeo=1 HTTP/1.1
Host: embed.vhx.tv

GET /videos/17901 HTTP/1.1
Host: api.vhx.tv
authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImQ2YmZlZmMzNGIyNTdhYTE4Y2E...

pass:

GET /subscriptions/17901?vimeo=1 HTTP/1.1
Host: embed.vhx.tv

GET /products/17901 HTTP/1.1
Host: api.vhx.tv
authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImQ2YmZlZmMzNGIyNTdhYTE4Y2E...

JWT fails:

GET /_next/jwt HTTP/1.1
Host: vimeo.com
X-Requested-With: XMLHttpRequest

GET /videos/17901 HTTP/1.1
Host: api.vhx.tv
authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NTk4MjY5O...

HTTP/2.0 401 Unauthorized

api.vimeo.com fails:

GET /_next/jwt HTTP/1.1
Host: vimeo.com
X-Requested-With: XMLHttpRequest

GET /videos/17901?fields=duration,download,name,pictures,release_time,user HTTP/1.1
Host: api.vimeo.com
Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NTk4MjcxN...

HTTP/1.1 404 Not Found

read write fails:

POST https://api.vhx.tv/oauth/token/ HTTP/2.0
accept: application/json
x-ott-agent: android site/40903 android-app/7.206.1
user-agent: Moonflix/7.206.2(Google Android SDK built for x86, Android 7.0 (API 24))
ott-client-version: 7.206.1
content-type: application/json
accept-encoding: identity

{
  "client_id": "85c89e1f5a386b54dbad29a60be04d64b45dfeb6fe710f408e55b0c6f1dedddc",
  "client_secret": "efec91dc214518ff812c46405e1025c3d0259defa6969313115a33effe716fd7",
  "grant_type": "client_credentials",
  "scope": "read write"
}

GET https://api.vhx.tv/videos/17901 HTTP/2.0
user-agent: Moonflix/7.206.2(Google Android SDK built for x86, Android 7.0 (API 24))
authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImQ2YmZlZmMzNGIyNTdhYTE4Y2E...
x-ott-agent: android site/40903 android-app/7.206.1
accept-encoding: identity
content-length: 0

HTTP/2.0 403 Forbidden

public fails:

POST https://api.vhx.tv/oauth/token/ HTTP/2.0
accept: application/json
x-ott-agent: android site/40903 android-app/7.206.1
user-agent: Moonflix/7.206.2(Google Android SDK built for x86, Android 7.0 (API 24))
ott-client-version: 7.206.1
content-type: application/json
accept-encoding: identity

{
  "client_id": "85c89e1f5a386b54dbad29a60be04d64b45dfeb6fe710f408e55b0c6f1dedddc",
  "client_secret": "efec91dc214518ff812c46405e1025c3d0259defa6969313115a33effe716fd7",
  "grant_type": "client_credentials",
  "scope": "public"
}

GET https://api.vhx.tv/videos/17901 HTTP/2.0
user-agent: Moonflix/7.206.2(Google Android SDK built for x86, Android 7.0 (API 24))
authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImQ2YmZlZmMzNGIyNTdhYTE4Y2E...
x-ott-agent: android site/40903 android-app/7.206.1
accept-encoding: identity
content-length: 0

HTTP/2.0 403 Forbidden

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Clip added in v1.46.7

type Clip struct {
	ID            int64
	Unlisted_Hash string
}

func New_Clip added in v1.54.6

func New_Clip(reference string) (*Clip, error)

type Config

type Config struct {
	SEO struct {
		Thumbnail   string
		Upload_Date string
	}
	Video struct {
		Duration int64
		ID       int64
		Title    string
	}
	Request struct {
		Files struct {
			Progressive []struct {
				Width  int64
				Height int64
				FPS    int64
				URL    string
			}
		}
	}
}

func (Config) Duration added in v1.55.7

func (c Config) Duration() time.Duration

func (Config) String added in v1.55.7

func (c Config) String() string

type Embed added in v1.42.8

type Embed struct {
	Config_URL string
}

func New_Embed added in v1.55.7

func New_Embed(ref string) (*Embed, error)

func (Embed) Config added in v1.55.7

func (e Embed) Config() (*Config, error)

type JSON_Web added in v1.54.5

type JSON_Web struct {
	Token string
}

func New_JSON_Web added in v1.54.5

func New_JSON_Web() (*JSON_Web, error)

func (JSON_Web) Video added in v1.54.5

func (w JSON_Web) Video(clip *Clip) (*Video, error)

type Video

type Video struct {
	Duration int64
	Name     string
	Pictures struct {
		Base_Link string
	}
	Release_Time string
	User         struct {
		Name string
	}
	Download []struct {
		Width      int64
		Height     int64
		Link       string
		Quality    string
		Size_Short string
	}
}

func (Video) Get_Duration added in v1.55.7

func (v Video) Get_Duration() time.Duration

func (Video) String added in v1.48.8

func (v Video) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL