Comments (6)
It looks like the following bit of code could be used to give the video the proper video tag, instead of tagging it as an image which is what happens now, causing the video to fail to load.
import magic
mime = magic.Magic(mime=True)
filename = mime.from_file(path_to_video)
if filename.find('video') != -1:
print('it is video')
From:
https://stackoverflow.com/questions/14919609/how-to-check-if-a-file-is-a-video
from mastodon-archive.
I ain't rich but I'd be happy to pay a 50 Euro bounty for a fix for this and #101, which would allow me to make the archive I need so badly for my PhD thesis. :)
from mastodon-archive.
Try 1deb199 and let me know if it works for you? I personally don't archive media so I had to fiddle with my test JSON file by hand.
from mastodon-archive.
Fantastic! Yes that works for the video. :)
The other issue with the images is still there of course.
This is outside of the scope of the bounty I offered, but I'm wondering if the browser will lazy load the videos automatically? The reason is that I'd like to host this as a static webpage on my site, but if it has to load 3 GB worth of video before the page is ready, it's gonna be rather slooow. Perhaps I'll test this tomorrow by putting up the html page on a test site.
But either way - thanks! It's looking much better now.
from mastodon-archive.
I don't see anything I could add for lazy loading, based on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video … but if you know what to do, leave a comment and we'll figure it out.
from mastodon-archive.
Hm, maybe try adding preload="none"
to the video_template
on https://github.com/kensanata/mastodon-archive/blob/main/mastodon_archive/html.py#L223 ? I'm not quite sure. If you have a lot of videos, you're in a better position to test this.
from mastodon-archive.
Related Issues (20)
- No main.py created in windows?? HOT 7
- Install "the Debian way" HOT 8
- getting mastodon-backup packaged (for Linux) HOT 19
- Generate tarball compatible to Mastodon's export HOT 5
- Specifying bookmarks or statuses with text search resets other specified collections HOT 2
- Feature: Backup / Export Filters HOT 8
- incremental runs of 'mastodon-archive' giving 404s on deleted mentions/replies on STDERR HOT 7
- Compress JSON HOT 8
- Consider making --with-followers and --with-following on by default? HOT 3
- Improve followers feature : consider more interactions HOT 4
- Report fails if no bookmark in archive (old archive) HOT 4
- Version check fails on Pleroma instance HOT 4
- HTML export to use cropped, centered images HOT 4
- HTML Export pages should lazy load videos and images to be usable as static sites HOT 14
- Add pagination numbers in html exports
- TypeError: 'NoneType' object is not subscriptable HOT 8
- Backup other account's public posts HOT 1
- Don't burst the API rate limiting HOT 1
- Archiving context HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mastodon-archive.