Open bufemc opened 5 years ago
And how should we rename a file which isn‘t on our servers? I think you got that wrong, we have access to the metadata like the Title but not the video files. The video files are only on the servers of the Öffentlich Rechtliche and their Mediatheken.
You can actually download a file and replace the original name with something else via javascript. I once did this for a project. The code looked like this:
axios({
url: 'http://exampleurl.com/file',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data], {type:'application/vnd.ms-excel'}));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'NewFileName.xls');
document.body.appendChild(link);
link.click();
});
I used axios but it should also work with your run-of-the-mill XHR Request or whichever fetching mechanism you guys use. The important part is in the promise.
I've had a similar idea for converting HLS streams into useful files. Great idea to use that for normal downloads too, thank you!
I've read the notes under: https://github.com/mediathekview/mediathekviewweb/issues/19
However, isn't it possible just to re-use the title shown on the left side (maybe via DOM) at least to give the file a meaningful name when saving it?
Example: Tatort: Murot und das Murmeltier
will be saved just as: 1280-1_357141.mp4
I think we all agree that a harddisk full of files named like this are quite a puzzle ;-)
Proposal, should be possible maybe by accessing DOM elements?: