Compare commits
5 commits
a4e6ea12ea
...
39fde37423
Author | SHA1 | Date | |
---|---|---|---|
39fde37423 | |||
862b36c1ae | |||
c83bae4088 | |||
4b7b1d0ea7 | |||
c76d6a80cc |
16 changed files with 17 additions and 10 deletions
0
LICENSE
Executable file → Normal file
0
LICENSE
Executable file → Normal file
2
README.md
Executable file → Normal file
2
README.md
Executable file → Normal file
|
@ -23,7 +23,7 @@ As you can see, the vast majority of my scripts are used to handle my [Friendica
|
|||
* friendica-find-largest-accounts.sh: Finds which are the contacts that have the most posts assigned to them.
|
||||
* friendica-delete-specific-contact.sh: Uses the same code as the previous scripts to delete all data from a specific user, particularly useful for unfollowed contacts with too many posts.
|
||||
* media-optimize-local.sh: For a given folder, it finds any image files within and compresses them. Requires `gifsicle`, `oxipng`, `jpegoptim`, and `cwebp` installed.
|
||||
* youtube-download-channel.sh: A wrapper to ease downloading metadata from subscriptions or channels, in order to export it as a CSV, and as a playlist DB file compatible with FreeTube. Requires `yt-dlp`, and optionally a cookie to download your subscriptions.
|
||||
* youtube-download-channel.sh: A wrapper to ease downloading metadata from subscriptions or channels, in order to export it as a CSV, and as a playlist DB file compatible with FreeTube. Requires `yt-dlp`, `jq`, and optionally a cookie to download your subscriptions.
|
||||
|
||||
# License
|
||||
|
||||
|
|
0
copy.sh
Executable file → Normal file
0
copy.sh
Executable file → Normal file
0
friendica-clean-database.sh
Executable file → Normal file
0
friendica-clean-database.sh
Executable file → Normal file
0
friendica-compress-storage.sh
Executable file → Normal file
0
friendica-compress-storage.sh
Executable file → Normal file
0
friendica-delete-non-follower-featured-posts.sh
Executable file → Normal file
0
friendica-delete-non-follower-featured-posts.sh
Executable file → Normal file
17
friendica-delete-old-users.sh
Executable file → Normal file
17
friendica-delete-old-users.sh
Executable file → Normal file
|
@ -112,12 +112,19 @@ if [[ -n $(type curl) && -n "${dbengine}" && -n $(type "${dbengine}") && -n $(ty
|
|||
echo "0 0 0 0 0 0 0 0 0 0 0 0" >"${tmpfile}"
|
||||
if [[ "${intense_optimizations}" -gt 0 ]]; then
|
||||
"${dbengine}" "${db}" -v -e "\
|
||||
alter table \`contact\` add index if not exists \`tmp_contact_baseurl\` (baseurl); \
|
||||
alter table \`contact\` add index if not exists \`tmp_contact_baseurl_addr\` (baseurl, addr); \
|
||||
alter table \`post-thread\` add index if not exists \`tmp_post_thread_id\` (\`owner-id\`, \`author-id\`, \`causer-id\`); \
|
||||
alter table \`post-thread-user\` add index if not exists \`tmp_post_thread_user_id\` (\`owner-id\`, \`author-id\`, \`causer-id\`); \
|
||||
alter table \`post-user\` add index if not exists \`tmp_post_user_id\` (\`owner-id\`, \`author-id\`, \`causer-id\`); \
|
||||
alter table \`post\` add index if not exists \`tmp_post_id\` (\`owner-id\`, \`author-id\`, \`causer-id\`); \
|
||||
alter table \`photo\` add index if not exists \`tmp_photo_id\` (\`contact-id\`); \
|
||||
select count(\`id\`) from contact c where \
|
||||
c.\`addr\` not in (select \`addr\` from \`contact\` where \`id\` in (select \`cid\` from \`user-contact\`)) and \
|
||||
c.\`addr\` not in (select \`addr\` from \`contact\` where \`id\` in (select \`uid\` from \`user\`)) and \
|
||||
c.\`addr\` not in (select \`addr\` from \`contact\` where \`id\` in (select \`contact-id\` from \`group_member\`)) and \
|
||||
c.\`contact-type\` != 4 and not pending and \`last-item\` < CURDATE() - INTERVAL ${period} and \
|
||||
c.\`nick\` not in ('threads.sys', 'relay', 'friendica', 'sharkey', 'bot', 'catodon', \
|
||||
'flipboard', 'lemmy', 'mitra', 'mstdn_bot', 'peertube', 'piefed', 'admin');
|
||||
"
|
||||
fi
|
||||
counter=0
|
||||
|
@ -133,9 +140,9 @@ if [[ -n $(type curl) && -n "${dbengine}" && -n $(type "${dbengine}") && -n $(ty
|
|||
fi
|
||||
done < <("${dbengine}" "${db}" -N -B -q -e \
|
||||
"select \`id\`, \`nick\`, \`baseurl\`, \`last-item\` from contact c where \
|
||||
c.\`id\` not in (select \`cid\` from \`user-contact\`) and \
|
||||
c.\`id\` not in (select \`uid\` from \`user\`) and \
|
||||
c.\`id\` not in ( select \`contact-id\` from \`group_member\`) and \
|
||||
c.\`addr\` not in (select \`addr\` from \`contact\` where \`id\` in (select \`cid\` from \`user-contact\`)) and \
|
||||
c.\`addr\` not in (select \`addr\` from \`contact\` where \`id\` in (select \`uid\` from \`user\`)) and \
|
||||
c.\`addr\` not in (select \`addr\` from \`contact\` where \`id\` in (select \`contact-id\` from \`group_member\`)) and \
|
||||
c.\`contact-type\` != 4 and not pending and \`last-item\` < CURDATE() - INTERVAL ${period} and \
|
||||
c.\`nick\` not in ('threads.sys', 'relay', 'friendica', 'sharkey', 'bot', 'catodon', \
|
||||
'flipboard', 'lemmy', 'mitra', 'mstdn_bot', 'peertube', 'piefed', 'admin') \
|
||||
|
@ -156,7 +163,7 @@ if [[ -n $(type curl) && -n "${dbengine}" && -n $(type "${dbengine}") && -n $(ty
|
|||
alter table \`post\` auto_increment = 1; \
|
||||
alter table \`photo\` auto_increment = 1; \
|
||||
alter table \`contact\` auto_increment = 1; \
|
||||
alter table \`contact\` drop index \`tmp_contact_baseurl\`; \
|
||||
alter table \`contact\` drop index \`tmp_contact_baseurl_addr\`; \
|
||||
alter table \`post-thread\` drop index \`tmp_post_thread_id\`; \
|
||||
alter table \`post-thread-user\` drop index \`tmp_post_thread_user_id\`; \
|
||||
alter table \`post-user\` drop index \`tmp_post_user_id\`; \
|
||||
|
|
0
friendica-delete-specific-contact.sh
Executable file → Normal file
0
friendica-delete-specific-contact.sh
Executable file → Normal file
0
friendica-find-largest-accounts.sh
Executable file → Normal file
0
friendica-find-largest-accounts.sh
Executable file → Normal file
0
friendica-find-missing-servers.sh
Executable file → Normal file
0
friendica-find-missing-servers.sh
Executable file → Normal file
0
friendica-fix-avatar-permissions.sh
Executable file → Normal file
0
friendica-fix-avatar-permissions.sh
Executable file → Normal file
0
friendica-remove-invalid-photos.sh
Executable file → Normal file
0
friendica-remove-invalid-photos.sh
Executable file → Normal file
2
friendica-remove-old-photos-parallel.sh
Executable file → Normal file
2
friendica-remove-old-photos-parallel.sh
Executable file → Normal file
|
@ -54,7 +54,7 @@ while read -r x; do
|
|||
while read -r y; do
|
||||
m=$((m + 1))
|
||||
loop "${x}" "${m}" "${n}" "${d}" "${y}" #&
|
||||
done < <(find "${x}" -type f -iname "*-48*")
|
||||
done < <(find "${x}" -type f \( -iname "*-48*" -or -iname "*-80*" -or -iname "*-320*" \))
|
||||
fi
|
||||
if [[ "${intense_optimizations}" -eq 1 ]]; then
|
||||
printf "\rFolder %d\tDone " "${n}"
|
||||
|
|
0
friendica-workerqueue.sh
Executable file → Normal file
0
friendica-workerqueue.sh
Executable file → Normal file
0
media-optimize-local.sh
Executable file → Normal file
0
media-optimize-local.sh
Executable file → Normal file
6
youtube-download-channel.sh
Executable file → Normal file
6
youtube-download-channel.sh
Executable file → Normal file
|
@ -27,7 +27,7 @@ archive="${subfolder}/${channel}.txt"
|
|||
sortcsv="${temporary}/${channel}-sort.csv"
|
||||
csv="${subfolder}/${channel}.csv"
|
||||
json="${subfolder}/${channel}.db"
|
||||
python="python"
|
||||
python="python3"
|
||||
if [[ -f "/opt/venv/bin/python" ]]; then
|
||||
python="/opt/venv/bin/python"
|
||||
fi
|
||||
|
@ -141,7 +141,7 @@ find "${temporary}" -type f -iname "*.info.json" | while read -r x; do
|
|||
fi
|
||||
echo "youtube $(jq -cr '.id' "${x}")" >>"${temporary}/${channel}.txt"
|
||||
if [[ ${enablecsv} = "1" ]]; then
|
||||
jq -c '[.upload_date, .timestamp, .uploader , .title, .webpage_url]' "${x}" | while read -r i; do
|
||||
jq -c '[.upload_date, .timestamp, .duration, .uploader , .title, .webpage_url]' "${x}" | while read -r i; do
|
||||
echo "${i}" | sed -e "s/^\[//g" -e "s/\]$//g" -e "s/\\\\\"/"/g" >>"${csv}"
|
||||
done
|
||||
fi
|
||||
|
@ -184,7 +184,7 @@ if [[ ${enabledb} = "1" ]]; then
|
|||
fi
|
||||
if [[ ${enablecsv} = "1" ]]; then
|
||||
sort "${csv}" | uniq >"${temporary}/${channel}-without-header.csv"
|
||||
echo '"Upload Date", "Timestamp", "Uploader", "Title", "Webpage URL"' >"${temporary}/${channel}.csv"
|
||||
echo '"Upload Date", "Timestamp", "Duration", "Uploader", "Title", "Webpage URL"' >"${temporary}/${channel}.csv"
|
||||
cat "${temporary}/${channel}-without-header.csv" >>"${temporary}/${channel}.csv"
|
||||
mv "${temporary}/${channel}.csv" "${csv}"
|
||||
rm "${temporary}/${channel}-without-header.csv"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue