@ -17,8 +17,8 @@ Spectator.describe "parse_video_info" do
# Basic video infos
expect ( info [ " title " ] . as_s ) . to eq ( " I Gave My 100,000,000th Subscriber An Island " )
expect ( info [ " views " ] . as_i ) . to eq ( 1 15_784_415 )
expect ( info [ " likes " ] . as_i ) . to eq ( 4_932_790 )
expect ( info [ " views " ] . as_i ) . to eq ( 1 26_573_823 )
expect ( info [ " likes " ] . as_i ) . to eq ( 5_157_654 )
# For some reason the video length from VideoDetails and the
# one from microformat differs by 1s...
@ -48,12 +48,12 @@ Spectator.describe "parse_video_info" do
expect ( info [ " relatedVideos " ] . as_a . size ) . to eq ( 20 )
expect ( info [ " relatedVideos " ] [ 0 ] [ " id " ] ) . to eq ( " iogcY_4xGjo " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " title " ] ) . to eq ( " $1 vs $1,000,000 Hotel Room !" )
expect ( info [ " relatedVideos " ] [ 0 ] [ " id " ] ) . to eq ( " Hwybp38GnZw " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " title " ] ) . to eq ( " I Built Willy Wonka's Chocolate Factory !" )
expect ( info [ " relatedVideos " ] [ 0 ] [ " author " ] ) . to eq ( " MrBeast " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " ucid " ] ) . to eq ( " UCX6OQ3DkcsbYNE6H8uQQuVA " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " view_count " ] ) . to eq ( " 17 2972109 " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " short_view_count " ] ) . to eq ( " 17 2 M" )
expect ( info [ " relatedVideos " ] [ 0 ] [ " view_count " ] ) . to eq ( " 17 9877630 " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " short_view_count " ] ) . to eq ( " 17 9 M" )
expect ( info [ " relatedVideos " ] [ 0 ] [ " author_verified " ] ) . to eq ( " true " )
# Description
@ -76,11 +76,11 @@ Spectator.describe "parse_video_info" do
expect ( info [ " ucid " ] . as_s ) . to eq ( " UCX6OQ3DkcsbYNE6H8uQQuVA " )
expect ( info [ " authorThumbnail " ] . as_s ) . to eq (
" https://yt3.ggpht.com/ytc/AL5GRJ UfhQdJS6n-YJtsAf-ouS2myDavDOq_zXBfebal3Q =s48-c-k-c0x00ffffff-no-rj"
" https://yt3.ggpht.com/ytc/AL5GRJ Vuqw82ERvHzsmBxL7avr1dpBtsVIXcEzBPZaloFg =s48-c-k-c0x00ffffff-no-rj"
)
expect ( info [ " authorVerified " ] . as_bool ) . to be_true
expect ( info [ " subCountText " ] . as_s ) . to eq ( " 1 35 M" )
expect ( info [ " subCountText " ] . as_s ) . to eq ( " 1 4 3M" )
end
it " parses a regular video with no descrition/comments " do
@ -99,7 +99,7 @@ Spectator.describe "parse_video_info" do
# Basic video infos
expect ( info [ " title " ] . as_s ) . to eq ( " Chris Rea - Auberge " )
expect ( info [ " views " ] . as_i ) . to eq ( 10_ 6 98_55 4)
expect ( info [ " views " ] . as_i ) . to eq ( 10_ 943_126 )
expect ( info [ " likes " ] . as_i ) . to eq ( 0 )
expect ( info [ " lengthSeconds " ] . as_i ) . to eq ( 283_i64 )
expect ( info [ " published " ] . as_s ) . to eq ( " 2012-05-21T00:00:00Z " )
@ -132,21 +132,21 @@ Spectator.describe "parse_video_info" do
# Related videos
expect ( info [ " relatedVideos " ] . as_a . size ) . to eq ( 1 8 )
expect ( info [ " relatedVideos " ] . as_a . size ) . to eq ( 1 9 )
expect ( info [ " relatedVideos " ] [ 0 ] [ " id " ] ) . to eq ( " rfyZrJUmzxU " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " title " ] ) . to eq ( " cheb mami - bekatni " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " author " ] ) . to eq ( " pelitov ic" )
expect ( info [ " relatedVideos " ] [ 0 ] [ " ucid " ] ) . to eq ( " UCs p6vFyJeGoLxgn-AsHp1tw " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " view_count " ] ) . to eq ( " 1 38636 19 " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " short_view_count " ] ) . to eq ( " 13M " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " id " ] ) . to eq ( " Ww3KeZ2_Yv4 " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " title " ] ) . to eq ( " Chris Rea " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " author " ] ) . to eq ( " PanMus ic" )
expect ( info [ " relatedVideos " ] [ 0 ] [ " ucid " ] ) . to eq ( " UCs KAPSuh1iNbLWUga_igPyA " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " view_count " ] ) . to eq ( " 315 81" )
expect ( info [ " relatedVideos " ] [ 0 ] [ " short_view_count " ] ) . to eq ( " 31K " )
expect ( info [ " relatedVideos " ] [ 0 ] [ " author_verified " ] ) . to eq ( " false " )
# Description
expect ( info [ " description " ] . as_s ) . to eq ( " " )
expect ( info [ " shortDescription " ] . as_s ) . to be_empty
expect ( info [ " descriptionHtml " ] . as_s ) . to eq ( " <p></p> ")
expect ( info [ " descriptionHtml " ] . as_s ) . to eq ( " ")
# Video metadata