module Youtube
Extended Modules
Defined in:
search/youtube.crConstant Summary
-
VALID_LINK_CLASSES =
["yt-simple-endpoint style-scope ytd-video-renderer", "yt-uix-tile-link yt-ui-ellipsis yt-ui-ellipsis-2 yt-uix-sessionlink spf-link "]
Instance Method Summary
-
#find_url(spotify_metadata : JSON::Any, flags = {} of String => String) : String | Nil
Finds a youtube url based off of the given information.
-
#is_valid_url(url : String) : Bool
Checks if the given URL is a valid youtube URL
Instance Method Detail
Finds a youtube url based off of the given information.
The query to youtube is constructed like this:
"<song_name> <artist_name>
Youtube.find_url("Bohemian Rhapsody", "Queen")
=> "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
def is_valid_url(url : String) : Bool
#
Checks if the given URL is a valid youtube URL
Youtube.is_valid_url("https://www.youtube.com/watch?v=NOTANACTUALVIDEOID")
=> false