commit d5a0bd0fdfb095d7b997223883fca5a2066e1fe9 Author: admin Date: Fri Nov 14 18:30:49 2025 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a1d80d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +audios/ +playlists/ diff --git a/convert.py b/convert.py new file mode 100644 index 0000000..468e064 --- /dev/null +++ b/convert.py @@ -0,0 +1,45 @@ +import os +import subprocess +from pathlib import Path +from concurrent.futures import ProcessPoolExecutor, as_completed +import multiprocessing + +def convert_file(filepath, out_dir): + filename = os.path.basename(filepath) + basename, _ = os.path.splitext(filename) + out_filename = basename + ".m4a" + out_path = os.path.join(out_dir, out_filename) + + # ffmpeg command to copy audio + proc = subprocess.run( + ["ffmpeg", "-i", filepath, "-vn", "-c:a", "copy", out_path], + capture_output=True + ) + + if proc.returncode != 0: + return f"ERROR: Failed to convert {filename}\n{proc.stderr.decode()}" + return f"Converted: {filename}" + +def main(): + cwd = Path.cwd() + in_dir = cwd / "playlists" + out_dir = cwd / "audios" + + os.makedirs(out_dir, exist_ok=True) + + files = [str(in_dir / f) for f in os.listdir(in_dir) if f.lower().endswith(('.mp4', '.mkv', '.mov'))] + + # Use number of CPU cores, with 16 files max per core + num_cores = multiprocessing.cpu_count() + max_workers = min(len(files), num_cores) + + print(f"Converting {len(files)} files using {max_workers} workers...") + + results = [] + with ProcessPoolExecutor(max_workers=max_workers) as executor: + futures = {executor.submit(convert_file, f, str(out_dir)): f for f in files} + for future in as_completed(futures): + print(future.result()) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/paths.txt b/paths.txt new file mode 100644 index 0000000..50cd440 --- /dev/null +++ b/paths.txt @@ -0,0 +1,167 @@ +/storage/emulated/0/DCIM/Surahs/529afcf329251d0fd69e6c8c8e200470.mp4 +/storage/emulated/0/DCIM/Surahs/404009183963cdd18edeb3bf06d56cf5.mp4 +/storage/emulated/0/DCIM/Surahs/c18b43756bf84c9bd5a03b578ca5d15e.mp4 +/storage/emulated/0/DCIM/Surahs/d7e4b9ae67bf94c739e134bcb3a4b1fc.mp4 +/storage/emulated/0/DCIM/Screen%20recordings/Screen_Recording_20240629_015448_TikTok.mp4 +/storage/emulated/0/DCIM/Screen%20recordings/Screen_Recording_20240629_015700_TikTok.mp4 +/storage/emulated/0/DCIM/Screen%20recordings/Screen_Recording_20240629_015809_TikTok.mp4 +/storage/emulated/0/DCIM/Screen%20recordings/Screen_Recording_20240711_020240_TikTok.mp4 +/storage/emulated/0/DCIM/Screen%20recordings/Screen_Recording_20240712_220002_TikTok.mp4 +/storage/emulated/0/DCIM/Screen%20recordings/Screen_Recording_20240826_010637_TikTok.mp4 +/storage/emulated/0/DCIM/Screen%20recordings/Screen_Recording_20240826_010735_TikTok.mp4 +/storage/emulated/0/DCIM/Screen%20recordings/Screen_Recording_20240921_221700_TikTok.mp4 +/storage/emulated/0/DCIM/Screen%20recordings/Screen_Recording_20240923_001428_TikTok.mp4 +/storage/emulated/0/Download/Snaptik.app_7406393069676858657.mp4 +/storage/emulated/0/Download/Jannah.mp4 +/storage/emulated/0/Download/Salil qawafi salil ( 𝕊𝕝𝕠𝕨𝕖𝕕 + ℝ𝕖𝕧𝕖𝕣𝕓 ).mp4 +/storage/emulated/0/Download/Qalu Lahu.mp4 +/storage/emulated/0/Download/Snaptik.app_7430089467513425184.mp4 +/storage/emulated/0/Download/Snaptik.app_7421885408931319072.mp4 +/storage/emulated/0/Download/Snaptik.app_7412057321662156040.mp4 +/storage/emulated/0/Download/ssstik.io_@sidraoderso_1730734461449.mp4 +/storage/emulated/0/Download/ssstik.io_1733419222407.mp4 +/storage/emulated/0/Download/ssstik.io_1733520435113.mp4 +/storage/emulated/0/Download/ssstik.io_@33.ahmadd_1733520475170.mp4 +/storage/emulated/0/Download/ssstik.io_@dagovski_salaf_1733520376586.mp4 +/storage/emulated/0/Download/ssstik.io_@tche_france3_1733515296423.mp4 +/storage/emulated/0/Download/ssstik.io_@walmuwahid_1733254572263.mp4 +/storage/emulated/0/Download/ssstik.io_1734258407698.mp4 +/storage/emulated/0/Download/ssstik.io_1734719481114.mp4 +/storage/emulated/0/Download/ssstik.io_@akhiawwab_1734719532567.mp4 +/storage/emulated/0/Download/ssstik.io_@igilik52_1734719803501.mp4 +/storage/emulated/0/Download/ssstik.io_@quranllzeyn_1734719574785.mp4 +/storage/emulated/0/Download/ssstik.io_@sawt_al_haqq4_1734372858848.mp4 +/storage/emulated/0/Download/ssstik.io_@vayneheryoll_1734604433338.mp4 +/storage/emulated/0/Download/ssstik.io_@qz7vx_1734449338157.mp4 +/storage/emulated/0/Download/ssstik.io_1734833607835.mp4 +/storage/emulated/0/Download/ssstik.io_1735095534363.mp4 +/storage/emulated/0/Download/ssstik.io_@makizxq_1735095674971.mp4 +/storage/emulated/0/Download/ssstik.io_@moataz.515.n_1734873119096.mp4 +/storage/emulated/0/Download/ssstik.io_@quran.awad_1734887699238.mp4 +/storage/emulated/0/Download/ssstik.io_@makizxq_1735095674971 (1).mp4 +/storage/emulated/0/Download/ssstik.io_@abod__214_1735238776047.mp4 +/storage/emulated/0/Download/ssstik.io_@quran_ye2_1735298221069.mp4 +/storage/emulated/0/Download/ssstik.io_@ummahathletes_1735516884746.mp4 +/storage/emulated/0/Download/ssstik.io_@mhd.aev2_1735781887004.mp4 +/storage/emulated/0/Download/ssstik.io_@murders_1735498162169.mp4 +/storage/emulated/0/Download/ssstik.io_@reminder_hq_1736375287358.mp4 +/storage/emulated/0/Download/ssstik.io_@salfisqw_1737072979657.mp4 +/storage/emulated/0/Download/ssstik.io_@zver_aep_1737072648036.mp4 +/storage/emulated/0/Download/ssstik.io_@users.l7_1737244332450.mp4 +/storage/emulated/0/Download/ssstik.io_@ahlul.hadith.wal.athar_1737500071967.mp4 +/storage/emulated/0/Download/ssstik.io_@amrouch___1737500140954.mp4 +/storage/emulated/0/Download/ssstik.io_@bint.saadd_1737500092505.mp4 +/storage/emulated/0/Download/ssstik.io_@sultanovva.salafiii_1737500166120.mp4 +/storage/emulated/0/Download/ssstik.io_@yus1bovvvv_1737500122548.mp4 +/storage/emulated/0/Download/ssstik.io_@quran_ye2_1737479983900.mp4 +/storage/emulated/0/Download/ssstik.io_@sawt_al_haqq4_1737493857564.mp4 +/storage/emulated/0/Download/ssstik.io_@shah1d.774_1737591257327.mp4 +/storage/emulated/0/Download/ssstik.io_@ihsan_dw_1738025554951.mp4 +/storage/emulated/0/Download/ssstik.io_@m1u_hammed_1737898484625.mp4 +/storage/emulated/0/Download/ssstik.io_@_.ass.1_1738025654233.mp4 +/storage/emulated/0/Download/ssstik.io_@leemmsss_1738025668602.mp4 +/storage/emulated/0/Download/ssstik.io_@shah1d.774_1738025693798.mp4 +/storage/emulated/0/Download/ssstik.io_@talibulhaqq_1737983197498.mp4 +/storage/emulated/0/Download/ssstik.io_@do.your.dhikr_1738145470815.mp4 +/storage/emulated/0/Download/ssstik.io_@hbo.amin_1738258777196.mp4 +/storage/emulated/0/Download/ssstik.io_@talibulhaqq_1738245201571.mp4 +/storage/emulated/0/Download/ssstik.io_@muslimsounds_1738801099966.mp4 +/storage/emulated/0/Download/ssstik.io_@salah161s_1738557435460.mp4 +/storage/emulated/0/Download/ssstik.io_@llyediits_1739216697541.mp4 +/storage/emulated/0/Download/ssstik.io_@ms._x.4_1739329261013.mp4 +/storage/emulated/0/Download/ssstik.io_@shar1ya_1_1739296397090.mp4 +/storage/emulated/0/Download/ssstik.io_@mountains.musafir_1739494972040.mp4 +/storage/emulated/0/Download/ssstik.io_@uhtiiiya_1739494931381.mp4 +/storage/emulated/0/Download/ssstik.io_@hmdxd_8_1739511337773.mp4 +/storage/emulated/0/Download/ssstik.io_@abod__214_1739473752173.mp4 +/storage/emulated/0/Download/ssstik.io_@religion_islam_50_1739828851008.mp4 +/storage/emulated/0/Download/ssstik.io_@wanrhet_1739828922369.mp4 +/storage/emulated/0/Download/ssstik.io_@muslim_q00_1739915754532.mp4 +/storage/emulated/0/Download/ssstik.io_1740008226324.mp4 +/storage/emulated/0/Download/ssstik.io_@farawilya_1740008242891.mp4 +/storage/emulated/0/Download/ssstik.io_@khanovvv_54_1740353304472.mp4 +/storage/emulated/0/Download/ssstik.io_1740172453231.mp4 +/storage/emulated/0/Download/ssstik.io_@c0nezzz_1740353432735.mp4 +/storage/emulated/0/Download/ssstik.io_@tawhid_mslmmkk_1740225442027.mp4 +/storage/emulated/0/Download/ssstik.io_@wyv.028_1740353357825.mp4 +/storage/emulated/0/Download/ssstik.io_@frhan_2005_1740353835106.mp4 +/storage/emulated/0/Download/ssstik.io_@darc_334_1740344650776.mp4 +/storage/emulated/0/Download/ssstik.io_@akhrrecites_1739713080466.mp4 +/storage/emulated/0/Download/ssstik.io_@miskinovskiy_1740614561002.mp4 +/storage/emulated/0/Download/ssstik.io_@muwahh1dun_1740541624754.mp4 +/storage/emulated/0/Download/ssstik.io_@asdfggpwopp_1741300589774.mp4 +/storage/emulated/0/Download/ssstik.io_@atlaspostingicons_1740542736055.mp4 +/storage/emulated/0/Download/ssstik.io_@w11cs_1741389745313.mp4 +/storage/emulated/0/Download/ssstik.io_@youandyourdeeds_1741647769365.mp4 +/storage/emulated/0/Download/ssstik.io_@khamzamans09_1741735043030.mp4 +/storage/emulated/0/Download/ssstik.io_@km22.114_1741689345862.mp4 +/storage/emulated/0/Download/ssstik.io_@biloldin.i7_1741735209248.mp4 +/storage/emulated/0/Download/ssstik.io_@gutoppa4_1741435261383.mp4 +/storage/emulated/0/Download/ssstik.io_@69ll39_1742077273100.mp4 +/storage/emulated/0/Download/ssstik.io_@appo4181_1742421497794.mp4 +/storage/emulated/0/Download/ssstik.io_@muratuly.asar_1742344425512.mp4 +/storage/emulated/0/Download/ssstik.io_@altunov.16_1742766220735.mp4 +/storage/emulated/0/Download/ssstik.io_@___h___002_1743111171382.mp4 +/storage/emulated/0/Download/ssstik.io_@turnezz1_1743195996558.mp4 +/storage/emulated/0/Download/ssstik.io_@akhfidunyaa__1743441195237.mp4 +/storage/emulated/0/Download/ssstik.io_@deenspecialist_1745022635436.mp4 +/storage/emulated/0/Download/ssstik.io_@sawt_al_haqq4_1745187964569.mp4 +/storage/emulated/0/Download/ssstik.io_@arys.zh_1746049655263.mp4 +/storage/emulated/0/Download/ssstik.io_@umar_sildinskiy.l_1746049752177.mp4 +/storage/emulated/0/Download/ssstik.io_@abubinyamin_1745936707909.mp4 +/storage/emulated/0/Download/ssstik.io_@appo4181_1746049881756.mp4 +/storage/emulated/0/Download/ssstik.io_@deenspecialist_1745749235984.mp4 +/storage/emulated/0/Download/ssstik.io_@hanbali0505_1746050350483.mp4 +/storage/emulated/0/Download/ssstik.io_@obaidabouladov_1745769139645.mp4 +/storage/emulated/0/Download/ssstik.io_@obilievoina_1746049960381.mp4 +/storage/emulated/0/Download/ssstik.io_@s0_vu_1_1745865811314.mp4 +/storage/emulated/0/Download/ssstik.io_@sawt_al_haqq4_1746050024916.mp4 +/storage/emulated/0/Download/ssstik.io_@sawt_al_haqq4_1746050175087.mp4 +/storage/emulated/0/Download/ssstik.io_@taw.lll_1746050083106.mp4 +/storage/emulated/0/Download/ssstik.io_@far7ola_1746388338823.mp4 +/storage/emulated/0/Download/ssstik.io_@musafir.701_1746739963080.mp4 +/storage/emulated/0/Download/ssstik.io_@qalb_words_1746740066267.mp4 +/storage/emulated/0/Download/ssstik.io_@quran_tauhid__1746739989950.mp4 +/storage/emulated/0/Download/ssstik.io_@t..n..g0_1746740039140.mp4 +/storage/emulated/0/Download/ssstik.io_@islam.lis10_1747084341222.mp4 +/storage/emulated/0/Download/ssstik.io_@q1nexny_1746956843981.mp4 +/storage/emulated/0/Download/ssstik.io_@khfar70_1747344493016.mp4 +/storage/emulated/0/Download/ssstik.io_@sawt_al_haqq4_1747255335335.mp4 +/storage/emulated/0/Download/ssstik.io_@sawt_al_haqq4_1747344473134.mp4 +/storage/emulated/0/Download/ssstik.io_@strikeforce.elite_1748124846840.mp4 +/storage/emulated/0/Download/ssstik.io_@1binyamin__1748209778860.mp4 +/storage/emulated/0/Download/ssstik.io_@theislamicafgakh_1748198793175.mp4 +/storage/emulated/0/Download/ssstik.io_@avaiz.edits_1748283778286.mp4 +/storage/emulated/0/Download/ssstik.io_@shamsul.haque.official_1749058379380.mp4 +/storage/emulated/0/Download/ssstik.io_@animesunnah_1749586184006.mp4 +/storage/emulated/0/Download/ssstik.io_@deenspecialist_1749586122566.mp4 +/storage/emulated/0/Download/ssstik.io_@deenspecialist_1749942532010.mp4 +/storage/emulated/0/Download/ssstik.io_@kkklabdu_1750284109451.mp4 +/storage/emulated/0/Download/ssstik.io_@magomavvv_1750284126774.mp4 +/storage/emulated/0/Download/ssstik.io_@nepokollebimie.20_1750284185148.mp4 +/storage/emulated/0/Download/ssstik.io_@q1nexny_1750284148100.mp4 +/storage/emulated/0/Download/ssstik.io_@islam_s96_1750630378886.mp4 +/storage/emulated/0/Download/ssstik.io_@quran_9264_1750630347537.mp4 +/storage/emulated/0/Download/ssstik.io_@chaev_________1751153005605.mp4 +/storage/emulated/0/Download/ssstik.io_@kryzer_200_1751152984575.mp4 +/storage/emulated/0/Download/ssstik.io_@sawt_al_haqq4_1751152921075.mp4 +/storage/emulated/0/Download/ssstik.io_@zri.35_1751152957544.mp4 +/storage/emulated/0/Download/ssstik.io_@6ezoss_1753408591447.mp4 +/storage/emulated/0/Download/ssstik.io_@aybazov_09_1753408627289.mp4 +/storage/emulated/0/Download/ssstik.io_@islam1031a_1751418001936 (1).mp4 +/storage/emulated/0/Download/ssstik.io_@nabi.buttaev_1753408679405.mp4 +/storage/emulated/0/Download/ssstik.io_@vermaledeitmma_1753665284445.mp4 +/storage/emulated/0/Download/ssstik.io_@218defacto_1754697467899.mp4 +/storage/emulated/0/Download/ssstik.io_@bouladovx_1755120792850.mp4 +/storage/emulated/0/Download/ssstik.io_@c_mouh_1755120812478.mp4 +/storage/emulated/0/Download/ssstik.io_@salyafistina_1756760104639.mp4 +/storage/emulated/0/Download/ssstik.io_@salyafistina_1756760122202.mp4 +/storage/emulated/0/Download/ssstik.io_@a.k.ra.mm_1757102939464.mp4 +/storage/emulated/0/Download/ssstik.io_@a.k.ra.mm_1757103075631.mp4 +/storage/emulated/0/Download/ssstik.io_@akhi.sb_1757102994079.mp4 +/storage/emulated/0/Download/ssstik.io_@axi_ufc_1757102961924 (1).mp4 +/storage/emulated/0/Download/ssstik.io_@gasano_v.01_1757103052968.mp4 +/storage/emulated/0/Download/ssstik.io_@noor.shad0w_1757103039324.mp4 +/storage/emulated/0/Download/ssstik.io_@noor.shad0w_1757103124035.mp4 +/storage/emulated/0/Download/ssstik.io_@salyafistina_1757103008327.mp4 +/storage/emulated/0/Download/ssstik.io_@sintemantoba_1757885721138.mp4 diff --git a/pull.py b/pull.py new file mode 100644 index 0000000..16b9ca5 --- /dev/null +++ b/pull.py @@ -0,0 +1,30 @@ +import subprocess +import os +from pathlib import Path +from urllib.parse import unquote + +if __name__ == "__main__": + cwd = Path.cwd() + + success_paths = [] + failed_paths = [] + + with open("./paths.txt", "r") as f: + for path in f: + path = unquote(path.strip()) + output_path = os.path.join(str(cwd), "playlists/", os.path.basename(path)) + res = subprocess.run(["adb", "pull", path.strip(), str(output_path)], capture_output=True) + if res.returncode != 0: + print(f"WARN: Failed to pull {path} into {str(output_path)}") + failed_paths.append(path) + else: + success_paths.append(path) + + print("Finished pulling files.") + + print("Success:", len(success_paths), "Failed:", len(failed_paths)) + + print("Failed copying following items:") + for p in failed_paths: print(p) + + diff --git a/push.py b/push.py new file mode 100644 index 0000000..dac7cbe --- /dev/null +++ b/push.py @@ -0,0 +1,23 @@ +import os +import subprocess +from pathlib import Path + + +CWD = Path.cwd() +AUDIOS_DIR = os.fsencode(os.path.join(CWD, "audios/")) +OUT_DIR = "/storage/emulated/0/Music/lifeplaylist/" + + +def main(): + files = os.listdir(AUDIOS_DIR) + + for i, f in enumerate(files): + print(f"pushing {i+1}/{len(files)}...") + filepath = os.path.join(AUDIOS_DIR, f) + + if subprocess.run(["adb", "push", filepath, OUT_DIR], capture_output=True).returncode != 0: + print("ERR: Failed to push file:", filepath) + + +if __name__ == "__main__": + main() diff --git a/query.sql b/query.sql new file mode 100644 index 0000000..43eba36 --- /dev/null +++ b/query.sql @@ -0,0 +1,16 @@ +SELECT + CASE + WHEN Folder.path LIKE 'file://%' + THEN SUBSTR(Folder.path, 8) || Media.filename + ELSE Folder.path || Media.filename + END AS full_path +FROM + Media +JOIN + Folder ON Folder.id_folder = Media.folder_id +WHERE + Media.id_media IN ( + SELECT media_id + FROM PlaylistMediaRelation + WHERE playlist_id = 6 + ); \ No newline at end of file