mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Add error for non-existent playlists
This commit is contained in:
parent
1d9c6f63e1
commit
a5e8f87a26
1 changed files with 5 additions and 2 deletions
|
@ -153,8 +153,11 @@ def fetch_playlist(plid)
|
||||||
, "")
|
, "")
|
||||||
document = XML.parse_html(body)
|
document = XML.parse_html(body)
|
||||||
|
|
||||||
title = document.xpath_node(%q(//h1[@class="pl-header-title"])).not_nil!.content
|
title = document.xpath_node(%q(//h1[@class="pl-header-title"]))
|
||||||
title = title.strip(" \n")
|
if !title
|
||||||
|
raise "Playlist does not exist."
|
||||||
|
end
|
||||||
|
title = title.content.strip(" \n")
|
||||||
|
|
||||||
description_html = document.xpath_node(%q(//span[@class="pl-header-description-text"]/div/div[1]))
|
description_html = document.xpath_node(%q(//span[@class="pl-header-description-text"]/div/div[1]))
|
||||||
description_html, description = html_to_content(description_html)
|
description_html, description = html_to_content(description_html)
|
||||||
|
|
Loading…
Reference in a new issue