File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -611,7 +611,26 @@ export function getVideoParamsFromUrl(url) {
611
611
612
612
function extractParams ( videoId ) {
613
613
paramsObject . videoId = videoId
614
- paramsObject . timestamp = urlObject . searchParams . get ( 't' )
614
+ let timestamp = urlObject . searchParams . get ( 't' )
615
+ if ( timestamp && ( timestamp . includes ( 'h' ) || timestamp . includes ( 'm' ) || timestamp . includes ( 's' ) ) ) {
616
+ const { seconds, minutes, hours } = timestamp . match ( / (?: (?< hours > ( \d + ) ) h ) ? (?: (?< minutes > ( \d + ) ) m ) ? (?: (?< seconds > ( \d + ) ) s ) ? / ) . groups
617
+ let time = 0
618
+
619
+ if ( seconds ) {
620
+ time += Number ( seconds )
621
+ }
622
+
623
+ if ( minutes ) {
624
+ time += 60 * Number ( minutes )
625
+ }
626
+
627
+ if ( hours ) {
628
+ time += 3600 * Number ( hours )
629
+ }
630
+
631
+ timestamp = time
632
+ }
633
+ paramsObject . timestamp = timestamp
615
634
}
616
635
617
636
const extractors = [
You can’t perform that action at this time.
0 commit comments