Forum Archive

NAS Access

Bienxanh

I have a collection of mp3 files on a NAS on my local network. I'd like to read the mp3 tags of some of these files using Pythonista. Can I access a file using its UNC path (e.g. "\NAS\Media\Music\Artist\Album\Song.mp3")? When I try to open that path, I get a "No such file or directory" exception.

It's a huge library and I don't want to put it in Dropbox.

mcriley821

Have you tried connecting through file explorer first? Doing so first may simplify access down to a file path similar to what you’ve tried

https://appletoolbox.com/use-smb-to-connect-to-your-nas-drive-with-files-in-ipados-or-ios-13/

cvp

if you configure your NAS as SMB server in the standard Files app,
like here

and, in the left files browser of Pythonista, you open the Music folder of the NAS as external folder, like here

you would be able to access your songs via a script like

import os
downloads_path = '/private/var/mobile/Library/LiveFiles/com.apple.filesystems.smbclientd/LTRovAMusique/Soirée/'
os.chdir(downloads_path)
filelist = os.listdir(downloads_path)
for file in filelist:
    print(file) 

N.b. The name LTRovAMusique is generated by Apple

cvp

To get this file path, share a song to this small Pythonista script

import appex
fil = appex.get_file_path()
print(fil)