sixem / tiktok-download-buttons

Adds download buttons to the web version of TikTok
https://addons.mozilla.org/en-US/firefox/addon/tiktok-download-buttons/
MIT License
29 stars 2 forks source link

Videos not embedding #18

Open tired9494 opened 3 months ago

tired9494 commented 3 months ago

Sorry, not a direct issue but something recently has changed and videos I download don't embed in discord anymore, I have to use other downloaders instead.

sixem commented 3 months ago

Hi,

Yes, I'm aware of this. I'm planning on adding an option to download the format with the highest compatibility in the next release.

This happened because I changed what sort of videos it'd prioritize, and in the official API, the videos with HEVC encoding, does have the highest resolution and bitrate, so that is being preferred. Problem with this, is that it doesn't have great browser support, so it doesn't play well in browser-based applications like Discord.

I wasn't aware of this when I added it, as I was just being made aware of there being higher resolution videos available within the API response, so I thought it would be fine, but for some use-cases, like yours - that's not the case, unfortunately. This has annoyed me as well, so I'll add an option for this soon.

Rivanix commented 3 months ago

Would this be related to why thumbnails are not showing up on the downloaded videos? Been having this weird issue where when I download any videos from tiktok using this, I cannot get the thumbnails to show up. It was fine before (but that was like last year).

Thank you for creating this add-on though. It's been a life saver!

sixem commented 3 months ago

Would this be related to why thumbnails are not showing up on the downloaded videos? Been having this weird issue where when I download any videos from tiktok using this, I cannot get the thumbnails to show up. It was fine before (but that was like last year).

Thank you for creating this add-on though. It's been a life saver!

Yep, that should be the same issue. The most high resolution format isn't that widely supported yet, so I'll add an option to prefer H.264 videos instead, which should fix both of these issues.

sixem commented 3 months ago

Sorry for the delay, I've been quite busy lately!

So, in the past week or so the mobile API has been completely blocked, so that no longer works at all to my understanding. I've attempted to add extraction of the web API data instead as a new way of getting the unwatermarked video URL, which is just data that is embedded into a HTML script on page load. This doesn't support the wide variety of different video formats as the mobile API did, but this also means that the video extracted should at least be in a format that is widely supported.

I've left the old API as a fallback in the chain of attempts, but the web API should now be the preferred way of downloading. If both of them fail, it should still just try to download the URL of the actual video element in the browser, which can be a bit 50/50 whether it works or not.

I've only been able to test this on my end, and so far it has worked fine for me, but this can be different for other people, as TikTok have been known for serving location-specific web versions in the past. It's hard for me to really account for this and to test it thoroughly with this in mind.

I've submitted the new update to both web stores now, so hopefully it works for most people. If there are any issues, then feel free to let me know. I'll keep this open for a bit in case of any issues with the new update.

Rivanix commented 3 months ago

I'm just glad the thumbnails seem to be working! If anything does seem to break I'll try to remember to post here. Thank you so much for fixing it!

wombat2024 commented 3 months ago

It's working perfectly again on my end, thanks for your effort @sixem !