remotes/1693045480750635534/spooky-22
Aevann1 2022-01-14 06:38:27 +02:00
parent de641d5879
commit e59bcfc467
5 changed files with 6 additions and 6 deletions

View File

@ -424,7 +424,7 @@ class Submission(Base):
@property
@lazy
def is_video(self):
return self.url and any((self.url.lower().endswith(x) for x in ('.mp4','.webm','.mov', '#t=0.1')))
return self.url and any((self.url.lower().endswith(x) for x in ('.mp4','.webm','.mov')))
@property
@lazy

View File

@ -247,9 +247,9 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False):
sanitized = sanitized.replace(replacing, htmlsource)
for i in re.finditer('>(https://.*?\.(mp4|webm|mov))</a></p>', sanitized):
sanitized = sanitized.replace(f'<p><a href="{i.group(1)}" rel="nofollow noopener noreferrer" target="_blank">{i.group(1)}</a></p>', f'<p><video controls preload="metadata" class="embedvid"><source src="{i.group(1)}" type="video/{i.group(2)}"></video>')
sanitized = sanitized.replace(f'<p><a href="{i.group(1)}" rel="nofollow noopener noreferrer" target="_blank">{i.group(1)}</a></p>', f'<p><video controls preload="none" class="embedvid"><source src="{i.group(1)}" type="video/{i.group(2)}"></video>')
for i in re.finditer('<p>(https:.*?\.(mp4|webm|mov))</p>', sanitized):
sanitized = sanitized.replace(i.group(0), f'<p><video controls preload="metadata" class="embedvid"><source src="{i.group(1)}" type="video/{i.group(2)}"></video>')
sanitized = sanitized.replace(i.group(0), f'<p><video controls preload="none" class="embedvid"><source src="{i.group(1)}" type="video/{i.group(2)}"></video>')
for rd in ["://reddit.com", "://new.reddit.com", "://www.reddit.com", "://redd.it", "://libredd.it"]:
sanitized = sanitized.replace(rd, "://old.reddit.com")

View File

@ -64,7 +64,7 @@ You can use Markdown formatting:
<tr>
<td>Video Files</td>
<td>https://files.catbox.moe/v4om92.mp4</td>
<td><video controls preload="metadata" class="embedvid"><source src="https://files.catbox.moe/v4om92.mp4" type="video/mp4"></video></td>
<td><video controls preload="none" class="embedvid"><source src="https://files.catbox.moe/v4om92.mp4" type="video/mp4"></video></td>
</tr>
<tr>
<td>Emojis</td>

View File

@ -429,7 +429,7 @@
{% elif p.is_video %}
<div class="row no-gutters">
<div class="col">
<video controls preload="metadata" class="embedvid">
<video controls preload="none" class="embedvid">
<source src="{{p.realurl(v)}}" type="video/mp4">
</video>
</div>

View File

@ -528,7 +528,7 @@
</div>
{% elif p.is_video %}
<div id="video-{{p.id}}" style="text-align: center" class="{% if p.over_18 or not ((v and v.cardview) or (not v and environ.get('CARD_VIEW') == '1')) %}d-none{% endif %} mt-4">
<video id="video2-{{p.id}}" controls preload="metadata" class="embedvid">
<video id="video2-{{p.id}}" controls preload="none" class="embedvid">
<source src="{{p.realurl(v)}}" type="video/mp4">
</video>
</div>