Skip to content

Instantly share code, notes, and snippets.

@noman-land
noman-land / open-vlc-m3u8-url-with-http.md
Created July 10, 2024 23:46 — forked from milesrichardson/open-vlc-m3u8-url-with-http.md
How to use VLC to watch m3u8 playlist at URL with custom HTTP referrer and user agent

Imagine this: it's Sunday afternoon at 1pm, and you want to watch some live content. But you don't have a TV subscription. So you do a little Googling, and eventually you find yourself on a sketchy website where you can watch the content you're looking for. But while the website has a video player, it's surrounded by advertisements, and probably a cryptominer too. You don't want this website eating your CPU for 2 hours while you're watching your favorite Sunday afternoon content.

Wouldn't it be nice if you could watch that video in VLC instead? Then you can close the sketchy website and still watch your content. It's like having your cake and taking a bite of it too!

Here's how you do it:

  1. Capture the m3u8 request in dev tools. Open the site (or just the iframe, if possible) in DevTools and click "play." Search the network tab for m3u8 and grab the first request.

  2. Run VLC with command line flags to set the User Agent and Referrer. From the request body, you need to copy the requested URL,

@noman-land
noman-land / appify
Created January 2, 2024 21:11 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@noman-land
noman-land / get_episodes.py
Last active September 1, 2023 05:32
Download all No Such Thing As A Fish episodes to current folder.
####
#
# Download all No Such Thing As A Fish episodes to current folder
#
# How to use: `python get_episodes.py`
#
# THIS WILL DOWNLOAD OVER 20 GIGABYTES OF MP3s
#
####
@noman-land
noman-land / python-generators-quiz.py
Created July 26, 2023 04:00
Python generators quiz
# Modified version of https://news.ycombinator.com/item?id=36859971
question_bank={
'1+1: ': '2',
'2+3: ': '5'
}
def Quiz():
for question, correct_answer in question_bank.items():
answer = yield question
@noman-land
noman-land / 1337.js
Created December 9, 2022 01:57
1337
((_,[t,a],x=[3])=>
((z, ...w)=>t[t[a]`Y29uc29sZQ`][t[a]`bG9n`](z[t[a]`bWFw`](t[a]), ...w))`SQ${~~!''}YW0${x[0]}d2hhdA${x[~~'']}dGhleQ${x[~~""]+++x[~~``]++}Y2FsbA`)`${[this,((j,t)=>`${j[t]}t${j[-``]}`)`ob${1}a`]}`
@noman-land
noman-land / deploy.yml
Created August 5, 2022 22:58 — forked from miguelmota/deploy.yml
Github actions deploy to IPFS and update Cloudflare TXT _dnslink subdomain example
name: deploy
on:
push:
branches:
- master
jobs:
set_environment:
outputs:
env_name: ${{ steps.setenv.outputs.env_name }}
from network import Bluetooth
from network import LoRa
import socket
## CONSTANTS ##
# Increment this to setup more devices
VERSION = 1
@noman-land
noman-land / WorkAgreement.sol
Last active December 29, 2018 01:14
Work agreement and taxes smart contracts
pragma solidity ^0.4.11;
contract TaxAuthority {
address public owner;
mapping (address => uint) public taxesCollected;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
pragma solidity ^0.4.24;
contract IdeaRegistry {
function registerIdea(uint hash) public;
}
contract IdeaValidator {
address owner;
address registryAddress;
mapping (address => bool) validators;
pragma solidity ^0.4.24;
contract IdeaRegistry {
struct Idea {
address owner;
uint[] links;
}
mapping(uint => Idea) registry;