aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/yt_data_extract/common.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2021-08-08 21:56:59 -0700
committerJesús <heckyel@hyperbola.info>2021-08-09 12:29:01 -0500
commit40fcee52c011488275dbf9cbba7c877245fe346c (patch)
tree9af774b6423dd97489595fb1a971f32f17ede78a /youtube/yt_data_extract/common.py
parent6c6c469fbd4277d80b3309b796466c32ec19a0d0 (diff)
downloadyt-local-40fcee52c011488275dbf9cbba7c877245fe346c.tar.lz
yt-local-40fcee52c011488275dbf9cbba7c877245fe346c.tar.xz
yt-local-40fcee52c011488275dbf9cbba7c877245fe346c.zip
Fix description extraction in search results
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube/yt_data_extract/common.py')
-rw-r--r--youtube/yt_data_extract/common.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/youtube/yt_data_extract/common.py b/youtube/yt_data_extract/common.py
index e0a3f7f..713fc0c 100644
--- a/youtube/yt_data_extract/common.py
+++ b/youtube/yt_data_extract/common.py
@@ -267,7 +267,11 @@ def extract_item_info(item, additional_info={}):
['ownerText', 'runs', 0, 'navigationEndpoint', 'browseEndpoint', 'browseId']
))
info['author_url'] = ('https://www.youtube.com/channel/' + info['author_id']) if info['author_id'] else None
- info['description'] = extract_formatted_text(multi_get(item, 'descriptionSnippet', 'descriptionText'))
+ info['description'] = extract_formatted_text(multi_deep_get(
+ item,
+ ['descriptionText'], ['descriptionSnippet'],
+ ['detailedMetadataSnippets', 0, 'snippetText'],
+ ))
info['thumbnail'] = normalize_url(multi_deep_get(item,
['thumbnail', 'thumbnails', 0, 'url'], # videos
['thumbnails', 0, 'thumbnails', 0, 'url'], # playlists