def description(self) -> str: """Get the video description. :rtype: str """ return self.player_response.get("videoDetails", {}).get( "shortDescription" ) or extract._get_vid_descr(self.watch_html)
def test_get_vid_desc(cipher_signature): expected = ( "PSY - ‘I LUV IT’ M/V @ https://youtu.be/Xvjnoagk6GU\n" "PSY - ‘New Face’ M/V @https://youtu.be/OwJPPaEyqhI\n" "PSY - 8TH ALBUM '4X2=8' on iTunes @\n" "https://smarturl.it/PSY_8thAlbum\n" "PSY - GANGNAM STYLE(강남스타일) on iTunes @ http://smarturl.it/PsyGangnam\n" "#PSY #싸이 #GANGNAMSTYLE #강남스타일\n" "More about PSY@\nhttp://www.youtube.com/officialpsy\n" "http://www.facebook.com/officialpsy\n" "http://twitter.com/psy_oppa\n" "https://www.instagram.com/42psy42\n" "http://iTunes.com/PSY\n" "http://sptfy.com/PSY\n" "http://weibo.com/psyoppa") assert extract._get_vid_descr(cipher_signature.watch_html) == expected