Skip to content

Instantly share code, notes, and snippets.

View sunflsks's full-sized avatar

sudhip nashi sunflsks

View GitHub Profile
@sunflsks
sunflsks / scrape.py
Last active August 12, 2024 19:37
Spotify Private API exploration: /v2/recently_played
# #!/usr/bin/env python3
'''
While working on my custom scrobbler program that utilizes the Spotify API, I noticed a limitation that many
others have also come across
(https://stackoverflow.com/questions/73240867/is-there-a-way-to-retrieve-more-than-50-recently-played-tracks-using-spotipy,
https://stackoverflow.com/questions/74190136/is-there-a-way-to-get-my-full-listening-history-from-the-spotify-api);
the public recently_played API seems to be limited to the 50 most recent tracks, no matter what. However, the spotify
app itself has a built-in Listening History feature that uses a private API to go further back in time. Curious (and with
some time to kill), I decided to look a bit into this API and see what it provides.
#!/usr/bin/env python3
import http.server
import socketserver
import subprocess
import json
PORT = 80
COMMAND = "systemctl is-active automator"
@sunflsks
sunflsks / oahd-wrapper.c
Last active January 12, 2024 07:09
convert an x86 bin to an arm through oahd-helper
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
void help(char* curbin) {
fprintf(stderr, "%s x86_bin arm64_output\n", curbin);
}
int main(int argc, char** argv) {
@sunflsks
sunflsks / paste.c
Last active October 13, 2024 00:57
simple win32 paste program
#include <windows.h>
#include <stdio.h>
int main(void) {
if (!OpenClipboard(NULL)) {
fprintf(stderr, "Failed to open clipboard!\n");
return 1;
}
HANDLE clipboard;

Keybase proof

I hereby claim:

  • I am sunflsks on github.
  • I am sunchipnacho (https://keybase.io/sunchipnacho) on keybase.
  • I have a public key whose fingerprint is 5B61 608A 748A 96EA 9CAB 16C6 5DC7 F6DB 2F41 5386

To claim this, I am signing this object:

@sunflsks
sunflsks / bundleinfo.m
Last active February 7, 2022 16:35
Program for reading bundle info on iOS
// Copyright (C) 2021 sunflsks
// This file is available under the MPL license, which can be found here at the time of writing (03/06/2021):
// https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt
#import <Foundation/Foundation.h>
#import <sys/types.h>
#include <sys/ioctl.h>