Showing posts with label xcode. Show all posts
Showing posts with label xcode. Show all posts

Error downloading audio: get_throttling_function_name: could not find match for multiple

 In the past I had posted this https://alashazam.blogspot.com/2023/05/python-program-to-download-music.html explaining how to download video using python library pytube

If you are still using this program, you will notice that it is recently not functional anymore 

As of end of June 2023, this program will crash with this error:

Error downloading audio: get_throttling_function_name: could not find match for multiple

and if you are investigating further you will also discover this error

pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple
During handling of the above exception, another exception occurred:

To fix the error - you will have to edit the file /lib/python3.10/site-packages/pytube/cipher.py
on line +287 and remove the ; character

so the new file will be like this


Once that change is made the pytube library will work again.

How to commit (vi or nano way)

As the .gitconfig editor

there are basically 2 options 'nano' and 'vi'

For nano

type a comment then press ctrl+X

then Y and enter

 

For vi

type i

followed by a comment

the press escape

then after the:

wq

and enter


 

Setting a Git Server on a LAN

 

Instead of relying on a third party platform, if you have a spare linux server, it can be handy to setup your own local git server.

That means that you will not have to rely on github, or gitlab, and can perform your own lab, with versioning

On the server - let's call this host "myHub"

these steps will have to be done:

- installing ssh (openssh-server)

- installing git 

on the client machine a ssh public key will have to be generated using

- ssh-keygen -o

the key will be in ~/.ssh/id_rsa.pub and will need to be copied over the server as authorized.

https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols

Back to the local git server "myHub"

$ adduser git

$ su git

$ cd

$ mkdir .ssh

$ chmod 700 .ssh

$ touch .ssh/authorized_keys

the file is created with 0 in size (empty)

$ chmod 600 .ssh/authorized_keys

I recommend to copy and paste the key from the client into the server (in /tmp).

then append this file into the authorized_keys file

$ cat /tmp/id_rsa.pub >> authorized_keys

If you follow the video above, then you will have the git repositories inside the /var/www folder

#  mkdir project.git

# chown git:git project.git

$ cd project.git

$ git init --bare

that is done for the server side

Now on the client side

go to your source (or folder you want to push into the git server "myHub")

then add the git remote address

$ git remote add origin git@myHub:/var/www/project.git main

$ git push --set-upstream origin master:main

$ git log

on the first commit, you will have to declare the user.email and user.name (as global or local)

and from other machine to fetch the source

$ git clone git@myHub:/var/www/project.it -b main

 


Linux script for youtube-dl


 #!/bin/bash
function usage
{
    echo "usage: yl [youtube-link]"
}
if [ "$1" != "" ]; then
 echo "Downloading $1"
 cd ~/Music
 echo "/usr/local/bin/youtube-dl --extract-audio --audio-quality 128K  --audio-format mp3 -l $1"
 /usr/local/bin/youtube-dl --extract-audio --audio-quality 128K  --audio-format mp3 -l $1
 echo "Done!"
fi



soupBackup.java (a backup solution for soup.io)

A backup solution to complete the cycle

After I explained that soup.io could be used to mirror (backup) a tumblr account here http://alashazam.blogspot.com/2014/11/tumblr-backup-solution.html
The idea to backup a soup.io account started to be a logical step.
After some research I found some - but none of them worked (mostly because they required additional libraries I could never found, or because there were obsolete or simply too old)

The existing solutions

Here they are : Soup.io Export Tools
soup official post -- have seen various laments about this not working, so. probably not working.

This is the official way to export (backup) your soup account and the result is a huge (depending on your account - mine was like 2.3MB) rss file - which is in fact an xml file - where all the posts are stored, except for the medias (pictures mostly)

backup script by @neingeist
A shell script (which requires xsltproc installed) - the author says on his github page that it doesn't work - pass

lua script by @severak
need lua (and some libraries like "parsers.dkjson" and "socket.http" which I could never found) - pass

soupIO downloader by @falk
This one was interesting but same requires additional libraries - "fs", "lazy", "async" and "http" couldn't find most of them - pass

download tool by @moebius
rar file not found - resulting in an error

backup to wordpress by @tiefpunkt
Not wanted to install a wordpress, on top of a tumblr, on top of a soup ... maybe I'll try one day .. just for fun.

A new backup solution in java


The idea was to start from the official export tools - generate the rss file then use that file to backup all the medias (store in the xml in the tag named "enclosure")
the java source is just doing that - it reads the rss file, look for the tag name, then start a download for each instance and that's it.

Where is the source : https://bitbucket.org/ever3st/soupbackup

Usage is simple : after downloading the soupBackup.java you can compile it on your machine with "javac soupBackup.java" or you can download that file from the bitbucket repository - or use the soupBackup.jar.
read the readme file for more details.

$ java soupBackup your-rss-file.rss
or
$ java -jar soupBackup.jar your-rss-file.rss

And then you will have to wait for all the files to be downloaded, which I repeat might take some time.

I've tested this program on my own soup.io account - and with small subset of that rss file.

The pro : it works,I've tested it this week, doesn't requires weird library - and java is pretty common - so feel free to change the code for your needs.
One of the cool upgrade that might be done, would be to add a filechooser to select the rss file, then ask for backup after a certain date (that would allow to use this backup solution from times to times to catch up on the new posts).

The cons : be careful it is an early version and might contains some bugs.

Compiling Megahal on mac

How to compile Megahal on Apple Platform with Xcode

Here is a step by step in picture - how to compile Megahal (already mention on this blog) with xcode.

You will find Megahal source at http://sourceforge.net/projects/megahal/files/

  • Step 1 : create a new project as "command line Utility" and "standard tool" :

  • Step 2: open megahal.h, megahal.c and main.c as source files (forget the debug.c file it isn't necessary and it won't compile (because of many errors))

  • Step 3 : In file megahal.c - put in comment the include "debug.h" - so it won't try to link with this file we don't want.
  • Step 4 : in main.c - put in comment the line include malloc.h - and instead add include "/usr/include/malloc.h" - then as in step 3 put in comment the call to "debug.h"
  • Step 5 : Go ahead and press Build and Go - in the build folder you will get the megahal-mac (assuming you named the project as such) and you can then use of the Aritificial Intelligence to play with (I choose Aliens - I like to speak with Bishop!)
That was easy!
Related Posts with Thumbnails