snobu / destreamer

Save Microsoft Stream videos for offline enjoyment.
MIT License
2.36k stars 440 forks source link

Problem with "publishTime" attribute #251

Closed FraH90 closed 3 years ago

FraH90 commented 3 years ago

Like I've said in a previous issue, I'm downloading videos with the following title format:

"{publishDate} - {publishTime} - {title} - {author} - {duration} - {uniqueId}\"

All is going well, the videos are downloaded accordingly to the script I've written in python and with the correct syntax for the title template.

However, I've noticed that the publishTime attribute doesn't seems to have any sense: it doesn't corrispond neither to the UTC Time that is indicated at the start of the video, and neither to the local time (Italy) in which the video has been actually recorded.

Now, I'm using publishTime attribute in the filename just to order every video in the order in which they've been recorded, so it doesnt matter till a certain degree, but it would be better if the time indicated in the filename does actually correspond to the UTC time indicated in the recording, or better my local time in which the recording has been actually started

To make you an example I have a video that I've just downloaded, with filename that goes something like: "2020-10-08 - 10.43.36 - ......", but the local time in which it has been recorded it's 8.30am (circa, I guess here that it could be 8.43am), and the corresponding UTC time at the start of the video is different from both times. So what actually really is the 10.43 time that compare in the filename?

FraH90 commented 3 years ago

PS: Okay, think I'm answering this myself, it seems that "publishTime" is referred to GMT... my local time is GMT+2, so it does seems right

lukaarma commented 3 years ago

Yeah all the timestamps are converted from a ISO 8601 GMT timestamps... @snobu I geuss we could implement the conversion to locale, should be easy enough?

Alex87a commented 3 years ago

Yeah all the timestamps are converted from a ISO 8601 GMT timestamps... @snobu I geuss we could implement the conversion to locale, should be easy enough?

Sorry @lukaarma, can I change the format from AAAA-MM-GG to GG-MM-AAAA?

FraH90 commented 3 years ago

Yeah all the timestamps are converted from a ISO 8601 GMT timestamps... @snobu I geuss we could implement the conversion to locale, should be easy enough?

Sorry @lukaarma, can I change the format from AAAA-MM-GG to GG-MM-AAAA?

I beg you, don't do this!!!! With the format AAAA-MM-GG the recordings are stored in a folder in the very same order they've been recorded!!!

If you change the format to GG-MM-AAAA this will not work anymore!

FraH90 commented 3 years ago

Yeah all the timestamps are converted from a ISO 8601 GMT timestamps... @snobu I geuss we could implement the conversion to locale, should be easy enough?

Sorry @lukaarma, can I change the format from AAAA-MM-GG to GG-MM-AAAA?

Trust me, I'm from Italy and here we use GG-MM-AAAA too, I found it strange to use the other format at first, but AAAA-MM-GG makes a loooot more sense when dealing with files, folder etc for the reason I've cited of

Alex87a commented 3 years ago

Ahahahaha @FraH90 also I come from Italy, so I found more sense in the other format, also because with the previous version the files were created with the format GG-MM-AAAA.

FraH90 commented 3 years ago

Ahahahaha @FraH90 also I come from Italy, so I found more sense in the other format, also because with the previous version the files were created with the format GG-MM-AAAA.

That's why I've said I understand you, but trust me is just a matter of habits, AAAA-MM-GG makes much more sense when dealing with PC. If you think about it, the files will be stored in the very same order they've been recorded in this way. If they wanna give you the option to decide which format to use for date-time it's ok, but personally I'll leave it the way it is now, it makes much more sense when dealing with files and folders.

lukaarma commented 3 years ago

@Alex87a I won't change it but I can show how you can do it yourself on your local copy of Destreamer

Alex87a commented 3 years ago

@Alex87a I won't change it but I can show how you can do it yourself on your local copy of Destreamer

Yes @lukaarma please. I would like to learn how to change it.

Alex87a commented 3 years ago

@Alex87a I won't change it but I can show how you can do it yourself on your local copy of Destreamer

Yes @lukaarma please. I would like to learn how to change it.

Can anyone help me?

lukaarma commented 3 years ago

replace this line https://github.com/snobu/destreamer/blob/ac0fdf54683a057e76f2c57a1b08c598358d4acc/src/VideoUtils.ts#L17 with return `${day}-${month}-${dateJs.getFullYear()}`;

Alex87a commented 3 years ago

sostituire questa riga https://github.com/snobu/destreamer/blob/ac0fdf54683a057e76f2c57a1b08c598358d4acc/src/VideoUtils.ts#L17

con return `${day}-${month}-${dateJs.getFullYear()}`;

Sorry but... I just don't know how. I searched the net to avoid disturbing you but honestly I could not understand... Could you explain me exactly which editor I can change the code with?

snobu commented 3 years ago

You change that locally on your machine. Notepad would do or any other text editor.

Alex87a commented 3 years ago

You change that locally on your machine. Notepad would do or any other text editor.

Hello @snobu, first of all thanks for replying! However, I don't understand which file I can open with Notepad, specifically which file is which, opening it, makes me change the code. Could you help me?

snobu commented 3 years ago

This file,

destreamer/src/VideoUtils.ts

Where destreamer is the name of the directory you cloned (or downloaded) this repository to.

Alex87a commented 3 years ago

This file,

destreamer/src/VideoUtils.ts

Where destreamer is the name of the directory you cloned (or downloaded) this repository to.

Sorry but it doesn't work, the date always remains in the previous format.

FraH90 commented 3 years ago

This file, destreamer/src/VideoUtils.ts Where destreamer is the name of the directory you cloned (or downloaded) this repository to.

Sorry but it doesn't work, the date always remains in the previous format.

You need to recompile destreamer using the same commands you've used at the beginning of the installation (skip obviously the git command)

lukaarma commented 3 years ago

@snobu do we want to use the locale time conversion to give a better UX?

snobu commented 3 years ago

I'd try to stay away from localization as much as possible since it comes with its own baggage. I see this issue as a very edge case, let's not put our efforts here unless we see a pattern of issues telling us the ISO date format is up to no good.