mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-13 12:58:27 +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
|
forwarded = None
|
||||||
forwardedUrl = 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')):
|
if (message := post.find('div', class_ = 'tgme_widget_message_text')):
|
||||||
content = message.get_text(separator="\n")
|
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:
|
else:
|
||||||
content = None
|
content = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user