forked from rDrama/rDrama
master
parent
7cbb27a528
commit
de641d5879
|
@ -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="none" 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="metadata" 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="none" class="embedvid"><source src="{i.group(1)}" type="video/{i.group(2)}"></video>')
|
||||
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>')
|
||||
|
||||
for rd in ["://reddit.com", "://new.reddit.com", "://www.reddit.com", "://redd.it", "://libredd.it"]:
|
||||
sanitized = sanitized.replace(rd, "://old.reddit.com")
|
||||
|
|
|
@ -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="none" class="embedvid"><source src="https://files.catbox.moe/v4om92.mp4" type="video/mp4"></video></td>
|
||||
<td><video controls preload="metadata" class="embedvid"><source src="https://files.catbox.moe/v4om92.mp4" type="video/mp4"></video></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Emojis</td>
|
||||
|
|
|
@ -429,7 +429,7 @@
|
|||
{% elif p.is_video %}
|
||||
<div class="row no-gutters">
|
||||
<div class="col">
|
||||
<video controls preload="none" class="embedvid">
|
||||
<video controls preload="metadata" class="embedvid">
|
||||
<source src="{{p.realurl(v)}}" type="video/mp4">
|
||||
</video>
|
||||
</div>
|
||||
|
|
|
@ -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="none" class="embedvid">
|
||||
<video id="video2-{{p.id}}" controls preload="metadata" class="embedvid">
|
||||
<source src="{{p.realurl(v)}}" type="video/mp4">
|
||||
</video>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue