omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    NAS Access

    Pythonista
    3
    4
    1201
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Bienxanh
      Bienxanh last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • mcriley821
        mcriley821 last edited by 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/

        1 Reply Last reply Reply Quote 0
        • cvp
          cvp last edited by 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

          1 Reply Last reply Reply Quote 0
          • cvp
            cvp last edited by cvp

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

            import appex
            fil = appex.get_file_path()
            print(fil)
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors