Skip to content

Commit dcc5560

Browse files
committed
🐛 [epgs] 末尾スラッシュが2重になると再生できない環境がある(#3)
1 parent 8ba52bd commit dcc5560

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@types/node": "^16.10.2",
3333
"@types/postcss-import": "^12.0.1",
3434
"@types/react-table": "^7.7.5",
35+
"@types/url-join": "^4.0.1",
3536
"@types/webpack": "^4",
3637
"autoprefixer": "^10.3.6",
3738
"css-loader": "^5",
@@ -70,6 +71,7 @@
7071
"react-use": "^17.3.1",
7172
"recoil": "^0.4.1",
7273
"reconnecting-websocket": "^4.4.0",
74+
"url-join": "^4.0.1",
7375
"yaml": "^1.10.2"
7476
},
7577
"peerDependencies": {

src/miraktest-epgs/api.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from "axios"
2+
import urljoin from "url-join"
23
import type { EPGSProgramRecord, EPGSChannel } from "./types"
34

45
export class EPGStationAPI {
@@ -104,6 +105,6 @@ export class EPGStationAPI {
104105
return data.records
105106
}
106107
getVideoUrl({ videoId }: { videoId: number }) {
107-
return `${this.baseUrl.href}/api/videos/${videoId}`
108+
return urljoin(this.baseUrl.href, `api/videos/${videoId}`)
108109
}
109110
}

yarn.lock

+10
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,11 @@
11261126
dependencies:
11271127
source-map "^0.6.1"
11281128

1129+
"@types/url-join@^4.0.1":
1130+
version "4.0.1"
1131+
resolved "https://registry.yarnpkg.com/@types/url-join/-/url-join-4.0.1.tgz#4989c97f969464647a8586c7252d97b449cdc045"
1132+
integrity sha512-wDXw9LEEUHyV+7UWy7U315nrJGJ7p1BzaCxDpEoLr789Dk1WDVMMlf3iBfbG2F8NdWnYyFbtTxUn2ZNbm1Q4LQ==
1133+
11291134
"@types/webpack-sources@*":
11301135
version "3.2.0"
11311136
resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-3.2.0.tgz#16d759ba096c289034b26553d2df1bf45248d38b"
@@ -7671,6 +7676,11 @@ urix@^0.1.0:
76717676
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
76727677
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
76737678

7679+
url-join@^4.0.1:
7680+
version "4.0.1"
7681+
resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7"
7682+
integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==
7683+
76747684
url-parse-lax@^3.0.0:
76757685
version "3.0.0"
76767686
resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"

0 commit comments

Comments
 (0)