Better HN
topnewbestaskshowjobs
Log inSign up

Andrews54757

304 karma · joined Oct 30, 2017 (9y ago) · 37 submissions

Submissions

comment 1y ago · link · parent

Good question! Indeed you can run the challenge code using headless Chromium and it will function [1]. They are constantly updating the challenge however, and may add additional checks in the future. I suppose Google wants to make it more expensive overall to scrape Youtube to deter the most egregious bots.

[1] https://github.com/LuanRT/BgUtils

comment 1y ago · link · parent

Nsig/sig - Special tokens which must be passed to API calls, generated by code in base.js (player code). This is what has broken for yt-dlp and other third party clients. Instead of extracting the code that generates those tokens (eg using regular expressions) like we used to, we now need to run the whole base.js player code to get these tokens because the code is spread out all over the player code.

PoToken - Proof of origin token which Google has lately been enforcing for all clients, or video requests will fail with a 403. On android it uses DroidGuard, for IOS, it uses built in app integrity apis. For the web it requires that you run a snippet of javascript code (the challenge) in the browser to prove that you are not a bot. Previously, you needed an external tool to generate these PoTokens but with the Deno change yt-dlp should be capable of producing these tokens by itself in the near future.

SABR - Server side adaptive bitrate streaming, used alongside Google's UMP protocol to allow the server to have more control over buffering, given data from the client about the current playback position, buffered ranges, and more. This technology is also used to do server-side ad injection. Work is still being done to make 3rd party clients work with this technology (sometimes works, sometimes doesn't).

Nsig/sig extraction example:

- https://github.com/yt-dlp/yt-dlp/blob/4429fd0450a3fbd5e89573...

- https://github.com/yt-dlp/yt-dlp/blob/4429fd0450a3fbd5e89573...

PoToken generation:

- https://github.com/yt-dlp/yt-dlp/wiki/PO-Token-Guide

- https://github.com/LuanRT/BgUtils

SABR:

- https://github.com/LuanRT/googlevideo

EDIT2: Addeded more links to specific code examples/guides

comment 2y ago · link · parent

In sticking to vanilla HTML/CSS/Javascript for my hobby projects over the past ten years, I've come to enjoy writing "simple" code with minimal dependencies and bare-bones interfaces. I believe that the skills I've learned in doing so has benefited me many times since then, especially during the times when I needed a specific tool, ASAP, for my job as a biomedical researcher. Without having the need to look up documentation, tease apart the workings of frameworks, I've been able to make hyper-specific web based guis for image labeling and more, sometimes quicker and better than the programmers hired for these jobs, who would otherwise need constant communication and supervision to ensure that the correct thing is built.

comment 2y ago · link · parent

A while back I installed uBlock on my grandparents' computer to help them avoid scammy ads. This change will make it more difficult and dangerous, for elderly users to browse the internet. As a young nerd, I can switch to Firefox easily, but I can't imagine it will be easy for everyone. My experience from using Firefox is that it has its own quirks, and comes with its own learning curve.

I don't know what to say but to encourage everyone to make some noise. Please let your representative know about this. Hopefully we can still put a stop to this before it's too late.

comment 2y ago · link · parent

I read both. They are both great but I like the original better. The new edition is accessible but I think the original's prose is beautiful.

comment 2y ago · link · parent

The "get in touch" button on blog.rendley.com leads to a 404 page: https://rendley.com/try-for-free

comment 2y ago · link · parent

It was pretty straightforward for me to install and use yt-dlp. On a Mac with Homebrew you can do `brew install yt-dlp` to install it in one command. IIRC yt-dlp also provides binaries you can install directly. I'm not sure if installing docker and running a web server is any way easier than that.

However, there are ways to download Youtube videos without installing a native app. For example, it is possible to use a library like Youtube.js [0] to make a browser extension that downloads Youtube videos directly. You won't find those on Google's web store due to policy, but you can find a handful on Github.

0: https://github.com/LuanRT/YouTube.js

comment 2y ago · link · parent

The moov contains a list of byte offsets which the player can use to directly access media data. You can skip the moofs and other headers inside by using gaps in the offsets.

comment 2y ago · link · parent

Having worked with some MP4 demuxing for my extension [1], I feel the pain. Lots of times I would play the video only to find inexplicable issues such as drifting audio. I highly recommend using an mp4 inspector tool, such as mp4box [2], to debug these issues.

1: https://github.com/Andrews54757/FastStream

2: https://gpac.github.io/mp4box.js/test/filereader.html

comment 2y ago · link · parent

Great article. I've always thought that pessimistic sci-fi dystopias were on the rise, but it turns out most still have positive endings. The observation about walking out of the theatre, and seeing the worst ahead of us is quite interesting.

It would be cool to compare with other, non sci-fi stories. EG: I have been noticing the rise of escapist fantasy narratives in popular media — wish fulfillment stories where a Mary Sue like main character rises above all challenges without struggle. You can see this particularly in light novels, manga, and anime in the now popularized "isekai", "cultivation", or "system progression" genres. It would be interesting to find out how the public's fascination with these types of stories correlate with economic, social, or political undulations in the real world.

comment 2y ago · link · parent

Requirements as listed by the article:

1. Browser extension has a wildcard pattern for content script.

2. Content script passes postMessage messages to the background script using sendMessage.

3. Background script passes the message to native application using sendNativeMessage.

4. Native application handles the message dangerously, leading to code execution.

Requirement 2 seems to be the most important. postMessage messages should never be passed to sendMessage raw without validation. Fortunately, this should be a rare occurrence in the wild. It only provides very specific benefits to use postMessage in an extension to begin with, and developers who do need to use it are more likely to be aware of the potential vulnerability.

comment 2y ago · link · parent

Really? What browser are you using? Is it up to date?

comment 2y ago · link · parent

Most sites still use a player that fetches a ".m3u8" or ".mpd" manifest file. The extension monitors webRequests and triggers when it sees a request to such a file.

comment 2y ago · link · parent

Thanks! You can already do that. Open a new tab, and then click the icon to make the player appear. It will fill the whole tab. Then use another tab to find videos on other websites. The new-tab player will automatically collect sources and you can play it by using the sources browser tool. You can then close the tab with the original website.

comment 2y ago · link · parent

I have trouble watching things without subtitles. I dislike most video players on websites since they don't give you the option to search for or manually upload subtitles.

This and other inconveniences motivated me to make a browser extension to fix bad video players on the internet. It works by replacing the video player with a custom one. It also allows me to see what the manifest URL is and what headers it uses so I can copy it over to VLC if I need to.

The extension is available on Github, you can find it here

https://github.com/Andrews54757/FastStream

comment 2y ago · link · parent

I'm sure children can distinguish fiction from reality better than adults give them credit for. Sure, it's possible for a kid to mimic a violent kid's show from time to time. But such incidents are rare, and seem to coincide with poor parenting for the most part.

That said, I find it reasonable to think that children may have an underdeveloped capacity to understand sophisticated phenomena such as social norms. I remember that I didn't truly understand the dynamic nature of social norms till middle school. Children can be quite trusting when it comes to moral instruction. In that sense, perhaps one can justify "sanitizing" stories for an audience with impaired discernment.

comment 2y ago · link · parent

You won't gain additional momentum from a loose belt. But a loose belt may give your body the chance to slip out. The impulse you feel from a tight belt will be no less than the impulse you feel from a loose one.

comment 2y ago · link · parent

Biological systems are not "engineered" in the same way a computer is. Computer chips, despite all their complexity, are designed to be understood by humans - they are modular, and abstract-able to facilitate design. Biological systems do not have these properties unless it is advantageous for the task at hand. You often have systems where everything interacts with everything else in meaningful ways. So it isn't really accurate to directly compare reverse engineering technology to reverse "engineering" nature

comment 2y ago · link · parent

I've developed some small extensions for fun. A couple of weeks ago I got an email from ExBoost with the subject "Collaboration To Grow Our Extensions." They wanted me to include their code in my extensions. I quote: "You show mine, I show yours. Zero cost, all win."

I thought it was suspicious and junked the email. It didn't seem any different from the other spam emails I got from scammers.

comment 2y ago · link · parent

After reading the books, I thought that there was some sort of underlying political meaning with the way Liu incorporates both philosophy, religion, and real world events (ie, the Cultural Revolution). Then I read the afterword and author interview transcripts where the author explicitly says that there is no such meaning.

> “As a science fiction writer who began as a fan, I do not use my fiction as a disguised way to criticize the reality of the present.”

Given that the author lives under an authoritarian government, I'm not sure if Liu's words should be taken at face value. But officially, a political interpretation of the book wouldn't be the authors intention.

21.

Show HN: Eliminate video buffering with a Chrome extension(faststream.online ↗)

5 points · by Andrews54757 · 2y ago · discuss

comment 2y ago · link · parent

The idea that society itself may be a living intelligent organism is fascinating. It's not a revolutionary idea in nature, (eg: the portuguese man o' war is composed of multiple animals), but when it is applied to human society, it feels mystical. I think this is because our ability to comprehend and interact with the macro level makes human organization feel more artificial. But if the rules of game theory/economics make society inevitable, could it not also be a natural process? Do we individuals control society or does society control us?

comment 3y ago · link · parent

Yep. There are some ridiculous web APIs out there that expose all sorts of things you'd think should remain private. Take the Battery Status API for example [1].

[1] https://developer.mozilla.org/en-US/docs/Web/API/Battery_Sta...

comment 3y ago · link · parent

This! It is frustrating that web apps like draw.io can't save to file directly using Firefox. It gets old having to save a new file every time you make a change.

Beyond that, the File System API would also allow for streamed downloads directly from the web-app. This would allow for web-apps to generate large download files without having to store a copy on a database (external server or IndexedDB), which is a privacy improvement. The only way to do this now is by using convoluted techniques to essentially do a MITM to a fake endpoint [1].

[1] https://github.com/jimmywarting/StreamSaver.js

comment 3y ago · link · parent

I'll check out the Discord server because I want to see cool stuff other people are making, but I have no intention of seriously marketing my extension. I don't really want it to "take off" and become popular.

To me, FastStream is just a fun hobby project, not a product. I intend to always keep it free without unnecessary bloat or spyware of any kind. So, I don't really have a desire for it to be "successful" beyond it being immediately useful to me and a couple of my friends.

comment 3y ago · link · parent

Isn't GLSL already supported by WebGL?

comment 3y ago · link · parent

Seems like it is a Youtube.js problem. will investigate, doesn't happen on Chrome.

EDIT: It seems like Firefox has some special unsafe eval rule breaking dash.js

EDIT2: Problem was actually FF's sendMessage not toString()'ing URL objects. I've fixed it in V1.2.1 for FF (approval by mozilla pending)

EDIT3: V1.2.1 (Firefox hotfix) is available now

https://addons.mozilla.org/en-US/firefox/addon/faststream/

comment 3y ago · link · parent

There is a javascript library for interfacing with Youtube's API directly. It can also run on browsers. Using this, it's pretty easy to create a simple extension that replaces the default video player with your own. You can do a lot to improve your experience this way. I've made one which allows for higher quality streaming, pre-buffering video in the background, more subtitling options, etc... [2] [3].

[1] https://github.com/LuanRT/YouTube.js

[2] https://github.com/Andrews54757/FastStream

[3] Chrome (also available for Firefox): https://chromewebstore.google.com/u/1/detail/faststream-vide...

comment 3y ago · link · parent

The Chrome Web Store already blocks any extension with the ability to download videos from Youtube with the excuse of it "enabling piracy." Ironic considering that they allow downloaders for any other site. Only Youtube.com is banned. It smells like anti-competitive behavior to me.

comment 3y ago · link · parent

I've seen some websites do this in the wild, it's why I recommend turning the sourcemaps off in the troubleshooting section of my anti-anti-debug tool.

It's pretty easy to circumvent this method, but honestly the user shouldn't have to configure their browsers to be resistant to anti-debugging. From the side of the website, it should be impossible to know if the debug tools are just open.

12