■ ■ ■ ■ ■ ■
snscrape/modules/telegram.py
| skipped 202 lines |
203 | 203 | | mKwargs['duration'] = durationStrToSeconds(durationStr) |
204 | 204 | | media.append(cls(**mKwargs)) |
205 | 205 | | |
206 | | - | <<<<<<< HEAD |
207 | | - | outlinks = [] |
208 | | - | for link in post.find_all('a'): |
209 | | - | if any(x in link.parent.attrs.get('class', []) for x in ('tgme_widget_message_user', 'tgme_widget_message_author')): |
210 | | - | # Author links at the top (avatar and name) |
211 | | - | continue |
212 | | - | if link['href'] == rawUrl or link['href'] == url: |
213 | | - | style = link.attrs.get('style', '') |
214 | | - | # Generic filter of links to the post itself, catches videos, photos, and the date link |
215 | | - | if style != '': |
216 | | - | image = re.findall('url\(\'(.*?)\'\)', style) |
217 | | - | if len(image) == 1: |
218 | | - | images.append(image[0]) |
219 | | - | continue |
220 | | - | if _SINGLE_MEDIA_LINK_PATTERN.match(link['href']): |
221 | | - | style = link.attrs.get('style', '') |
222 | | - | image = re.findall('url\(\'(.*?)\'\)', style) |
223 | | - | if len(image) == 1: |
224 | | - | images.append(image[0]) |
225 | | - | continue |
226 | | - | href = urllib.parse.urljoin(pageUrl, link['href']) |
227 | | - | if href not in outlinks: |
228 | | - | outlinks.append(href) |
229 | | - | else: |
230 | | - | content = None |
231 | | - | outlinks = [] |
232 | | - | images = [] |
233 | | - | video = None |
234 | | - | ======= |
235 | | - | >>>>>>> master |
236 | 206 | | linkPreview = None |
237 | 207 | | if (linkPreviewA := post.find('a', class_ = 'tgme_widget_message_link_preview')): |
238 | 208 | | kwargs = {} |
| skipped 122 lines |