Menu

AP -t stdout?

2008-11-26
2013-04-29
  • borat jankins

    borat jankins - 2008-11-26

    I'm trying to use AP to retrieve tag info by grabbing its output via python. However the output is not the same as it would be from cmd.exe? There appears to be raw bytes\weird encoding before the output, and the alignment is all off on the tag data.

    This was intended to be a quick 'hack', thus I don't care to mess witth atoms. What am I missing? Thanks.

     
    • Dan Hinsley

      Dan Hinsley - 2008-11-26

      I do exactly what you are trying to do, but from a VB.NET program instead of from python, and it works for me.  What OS are you running on?

       
    • borat jankins

      borat jankins - 2008-11-26

      Windows XP SP2. I can view the output from cmd.exe no problem but when I output it to a file or try to grab the data from python with popen\subprocess it is all borked. No spaces between the tag data it fetched. It's all on the top line. Then the defining values like Track: are after it. It's not parsable. Thanks for the quick response. Perhaps I'll try perl instead or a diff version of AP?

       
      • Dan Hinsley

        Dan Hinsley - 2008-11-26

        If you like I can send you the version of ap I use.  I can redirect it to a file and it looks fine.  let me know.

        Dan

         
    • borat jankins

      borat jankins - 2008-11-26

      Also, here is the output I'm getting:

      Found 3 items to process...
      Executing C:\AtomicParsley-win32-0.9.0\AtomicParsley.exe C:\3gp\3rd Man In.3gp -t...
      ['\xc3\xaf\xc2\xbb\xc2\xbfThe Singles CollectionRockDropkick Murphys3rd Man InUser data "albm" [lang=jpn (utf16)] :   |  Track: 5\n', 'User data "gnre" [lang=jpn (utf16)] : \n', 'User data "perf" [lang=jpn (utf16)] : \n', 'User data "titl" [lang=jpn (utf16)] : \n', 'User data "yrrc" : 2000\n']

      Any ideas? Whats with the rawbytes?

       
    • borat jankins

      borat jankins - 2008-11-26

      If you could send  it my way I'd appreciate it. I've tried all versions posted on this site, and also tried using perl with the same results. When I tried the non unicode version it displays without the rawbytes but the spacing is still borked. I notice also if I try to pipe it to '| more' the output is still borked. It's only displaying properly via cmd.exe stdout? Would you mind also sending me your vb.net code? Atleast the execution part? Thanks again man.

       
    • borat jankins

      borat jankins - 2008-11-27

      FYI: I just tried using c#, and it yields the same output.

       
      • Dan Hinsley

        Dan Hinsley - 2008-11-27

        Did you try the version of ap I put up on my website?

         
        • borat jankins

          borat jankins - 2008-11-27

          Yes. And it yielded the same results. I sent you some info. Thanks. I looked at the AP source and for some reason its outputting some unicode + BOM stuff. I can't get python, etc to parse it properly thus far...

           
    • borat jankins

      borat jankins - 2008-11-28

      I resolved this issue. After looking through the AP source I found:

              if (wmemcmp(arguments[0] + (name_len-9), L"-utf8.exe", 9) == 0 || wmemcmp(arguments[0] + (name_len-9), L"-UTF8.exe", 9) == 0) {
                      UnicodeOutputStatus = UNIVERSAL_UTF8;
              } else {
                      UnicodeOutputStatus = WIN32_UTF16;
              }

      So I renamed a copy of ap to -utf8 and it outputs fine. :)

       

Log in to post a comment.