File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,17 @@ function change_url_param(key, value) {
5151}
5252
5353function autocorrect_url ( input_url ) {
54- url = input_url
55- if ( url . startsWith ( "youtube.com" ) ) {
56- url = "https://www." + url
54+ url = input_url ;
55+ if ( url . includes ( "youtu.be" ) ) {
56+ url = "https://www.youtube.com/watch?v=" + url . split ( "/" ) . pop ( ) ;
57+ } else if ( url . startsWith ( "youtube.com" ) ) {
58+ url = "https://www." + url ;
5759 } else if ( url . startsWith ( "www" ) ) {
58- url = "https://" + url
60+ url = "https://" + url ;
5961 }
6062
6163 if ( url . includes ( "&t=" ) ) {
62- url = url . split ( "&t=" ) [ 0 ]
64+ url = url . split ( "&t=" ) [ 0 ] ;
6365 }
6466
6567 return url
@@ -184,11 +186,7 @@ function get_rating(rating_percent) {
184186 }
185187
186188 for ( rating in ratings ) {
187- console . log ( rating )
188- console . log ( rating_percent )
189- console . log ( )
190189 if ( rating_percent < rating ) {
191- console . log ( "done!" )
192190 return ratings [ rating ]
193191 } else {
194192 continue
You can’t perform that action at this time.
0 commit comments