mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-11 03:48:29 +03:00
moved forward finding out of tgme_widget_message_text clause, since it wasn't correctly getting the forwarding information in forwarded posts that contained attachments but no text
This commit is contained in:
@@ -123,14 +123,13 @@ class TelegramChannelScraper(snscrape.base.Scraper):
|
||||
forwarded = None
|
||||
forwardedUrl = None
|
||||
|
||||
if (forward_tag := post.find('a', class_ = 'tgme_widget_message_forwarded_from_name')):
|
||||
forwardedUrl = forward_tag['href']
|
||||
forwardedName = forwardedUrl.split('t.me/')[1].split('/')[0]
|
||||
forwarded = Channel(username = forwardedName)
|
||||
|
||||
if (message := post.find('div', class_ = 'tgme_widget_message_text')):
|
||||
content = message.get_text(separator="\n")
|
||||
|
||||
if (forward_tag := post.find('a', class_ = 'tgme_widget_message_forwarded_from_name')):
|
||||
forwardedUrl = forward_tag['href']
|
||||
forwardedName = forwardedUrl.split('t.me/')[1].split('/')[0]
|
||||
forwarded = Channel(username = forwardedName)
|
||||
|
||||
else:
|
||||
content = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user