Prechádzať zdrojové kódy

iZpl, some C# crawlimng quicky and a bunch of random crap

LH 5 mesiacov pred
rodič
commit
de6637f1a1

+ 143 - 0
NETQuickies/SWR1HLSURLGen/Program.cs

@@ -0,0 +1,143 @@
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Threading;
+
+namespace SWR1HLSURLGen
+{
+    class Program
+    {
+        // wget -nc https://swrevent03hls.akamaized.net/hls/live/2016768-b/event03/20231019T082004/master-720p-3628/00040/master-720p-3628_00034.ts || exit
+        static void Main(string[] args)
+        {
+            //args = new string[] { "livesuck", "1", "1950" };
+            Console.WriteLine(args.Length);
+            bool suckle = false;
+            if (args.Length >= 1)
+            {
+                if (args[0] == "livesuck")
+                {
+                    args = args.Skip(1).ToArray(); //shiftleft 1
+                    suckle = true;
+                }
+            }
+
+            String prefix = "https://swrevent03hls.akamaized.net/hls/live/2016768-b/event03/20240912T144236/master-720p-3628/";
+            String infix = "/master-720p-3628_";
+            String suffix = ".ts";
+
+
+            int startingoffset;
+            int startingsegment;
+            if (args.Length == 5)
+            {
+                prefix = args[0];
+                startingsegment = int.Parse(args[1]);
+                infix = args[2];
+                startingoffset = int.Parse(args[3]);
+                suffix = args[4];
+            }
+            else
+            {
+                startingsegment = int.Parse(args[0]);
+                startingoffset = int.Parse(args[1]);
+            }
+
+            Console.WriteLine(@"#!/bin/bash
+cd /home/web/radiotapes/videotape/segmented");
+
+            bool backfill = true; //XXX
+            if (suckle)
+            {
+                String pathbase = "/home/web/radiotapes/videotape/segmented/autosuckle/";
+
+                int backfillSegment = startingsegment;
+                int backfillOffset = startingoffset;
+                int currentSegment = startingsegment;
+                int currentOffset = startingoffset;
+
+                while(true)
+                {
+                    if (backfill)
+                    {
+                        String backfillSegmentE = currentSegment.ToString("D5");
+                        String backfillOffsetE = currentOffset.ToString("D5");
+                        Console.WriteLine("Backfilling "+ backfillSegmentE + " "+ backfillOffsetE);
+                        Directory.CreateDirectory(pathbase + backfillSegmentE);
+                        Process p = new Process();
+                        p.StartInfo.FileName = "wget";
+                        p.StartInfo.Arguments = "-nc " + prefix + backfillSegmentE + infix + backfillOffsetE + suffix;
+                        p.StartInfo.WorkingDirectory = pathbase + backfillSegmentE;
+                        p.Start();
+                        p.WaitForExit();
+                        if(p.ExitCode>0)
+                        {
+                            Console.WriteLine("Backfill failure, 404, stopping backfill");
+                            backfill = false;
+                        }
+                        backfillOffset--;
+                        if(backfillOffset==0)
+                        {
+                            backfillSegment--;
+                            backfillOffset = 2000;
+                        }
+                    }
+                    if(currentSegment!=backfillSegment||!backfill)
+                    {
+                        String currentSegmentE = currentSegment.ToString("D5");
+                        String currentOffsetE = currentOffset.ToString("D5");
+                        Console.WriteLine("Pulling " + currentSegmentE + " " + currentOffsetE);
+                        //*
+                        Directory.CreateDirectory(pathbase + currentSegmentE);
+                        Process p = new Process();
+                        p.StartInfo.FileName = "wget";
+                        p.StartInfo.Arguments = "-nc " + prefix + currentSegmentE + infix + currentOffsetE + suffix;
+                        p.StartInfo.WorkingDirectory = pathbase + currentSegmentE;
+                        p.Start();
+                        p.WaitForExit();/**/
+                        bool error = p.ExitCode != 0;
+                        if(error)
+                        {
+                            Console.WriteLine("Bonk, need to wait,segment not ready yet");
+                        }
+                        else
+                        {
+                            currentOffset++;
+                            if(currentOffset>2000)
+                            {
+                                currentOffset = 1;
+                                currentSegment++;
+                            }
+
+                        }
+                        if (!backfill)
+                        {
+                            Thread.Sleep(2000);
+                        }
+                    }
+                }
+            }
+            else
+            {
+                for (int i = startingsegment; i < startingsegment + 100; i++)
+                {
+                    String outeridx = i.ToString("D5");
+                    Console.WriteLine("mkdir -p " + outeridx);
+                    Console.WriteLine("cd " + outeridx);
+                    int innerstart = 1;
+                    if (i == startingsegment) //edgecase first loop
+                    {
+                        innerstart = startingoffset;
+                    }
+                    for (int j = innerstart; j <= 2000; j++)
+                    {
+                        String inneridx = j.ToString("D5");
+                        Console.WriteLine("wget -nc " + prefix + outeridx + infix + inneridx + suffix + " || exit");
+                    }
+                    Console.WriteLine("cd ..");
+                }
+            }
+        }
+    }
+}

+ 8 - 0
NETQuickies/SWR1HLSURLGen/SWR1HLSURLGen.csproj

@@ -0,0 +1,8 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net5.0</TargetFramework>
+  </PropertyGroup>
+
+</Project>

+ 25 - 0
NETQuickies/SWR1HLSURLGen/SWR1HLSURLGen.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31321.278
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWR1HLSURLGen", "SWR1HLSURLGen.csproj", "{D4E39A1E-5DE7-42D4-AA9A-BB55FEBC29FD}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{D4E39A1E-5DE7-42D4-AA9A-BB55FEBC29FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D4E39A1E-5DE7-42D4-AA9A-BB55FEBC29FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D4E39A1E-5DE7-42D4-AA9A-BB55FEBC29FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D4E39A1E-5DE7-42D4-AA9A-BB55FEBC29FD}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {31554B07-3899-4C5F-A236-D5932842FA52}
+	EndGlobalSection
+EndGlobal

+ 1 - 0
QuickStuff/build.gradle

@@ -11,4 +11,5 @@ dependencies{
     implementation 'org.bouncycastle:bcprov-ext-jdk18on:1.71'
     implementation 'com.fazecast:jSerialComm:[2.0.0,3.0.0)'
     implementation 'com.eclipsesource.minimal-json:minimal-json:0.9.5'
+    implementation 'org.apache.httpcomponents:httpclient:4.5.14'
 }

+ 2 - 2
QuickStuff/src/main/java/PV/UI.java

@@ -22,8 +22,8 @@ public class UI extends javax.swing.JFrame
     {
         initComponents();
         
-        String fp = "C:\\Users\\LH\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\wb5ap89r.default\\places.sqlite";
-        String fp2="C:\\lmaa\\imgur-hunt.txt";
+        String fp = "C:\\Users\\LH\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\wb5ap89r.default\\places - Kopie.sqlite";
+        String fp2="C:\\lmaa\\fickdichhärter.txt";
         DBWriter dbw = new DBWriter("", fp, "", "", DBWriter.DBTYPE_SQLite);
         //String[][] items = dbw.queryTable("SELECT url , id FROM moz_places");
         String[][] idmap = dbw.queryTable("SELECT place_id , visit_date from moz_historyvisits  ORDER BY visit_date");

+ 106 - 0
QuickStuff/src/main/java/QuickVerifyCrap/SerialSpammer.java

@@ -0,0 +1,106 @@
+package QuickVerifyCrap;
+
+import com.fazecast.jSerialComm.SerialPort;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.RandomAccessFile;
+
+enum NextChunkAction
+{
+    WAIT,
+    REPEAT,
+    CONTINUE,
+    FINISHED
+}
+
+public class SerialSpammer
+{
+   
+    public static void main(String[] args)
+    {
+        System.out.println("Gobblygob");
+        RandomAccessFile streamfile = null;
+        int sendOffset = 0;
+        NextChunkAction nextChunkReady = NextChunkAction.WAIT;
+        
+        SerialPort comPort = SerialPort.getCommPort("ttyACM0");
+        comPort.openPort();
+        comPort.setComPortTimeouts(SerialPort.TIMEOUT_READ_SEMI_BLOCKING, 0, 0);
+        InputStream in = comPort.getInputStream();
+        OutputStream o = comPort.getOutputStream();
+        try
+        {
+            while(true)
+            {
+                int chara = System.in.read();
+                if(chara ==-1)
+                {
+                    return;
+                }
+                if(chara == '>')
+                {
+                    char[] filepath = new char[4096];
+                    int pathptr = 0;
+                    chara = System.in.read();
+                    while(chara != '\n'&&pathptr<4096)
+                    {
+                        filepath[pathptr]=(char)chara;
+                        pathptr++;
+                        chara = System.in.read();
+                    }
+                    if(pathptr==4096)
+                    {
+                        System.out.println("Zarf, pathdork");
+                    }
+                    else
+                    {
+                        String path = new String(filepath);
+                        System.out.println("Streaming: "+path);
+                        if(new File(path).exists())
+                        {
+                            streamfile = new RandomAccessFile(path,"r");
+                            nextChunkReady=NextChunkAction.CONTINUE;
+                        }
+                    }
+                }
+                if(streamfile!=null)
+                {
+                    switch(nextChunkReady)
+                    {
+                        case REPEAT:
+                            if(streamfile.getFilePointer()>=64)
+                            {
+                                streamfile.seek(streamfile.getFilePointer()-64);
+                            }
+                        case CONTINUE:
+                            byte[] readbfr = new byte[64];
+                            streamfile.read(readbfr);
+                            o.write('>');
+                            o.write(readbfr);
+                            nextChunkReady=NextChunkAction.WAIT;
+                        break;
+                        case WAIT:
+                            //NOP;
+                            break;
+                    }
+                }
+                while(in.available()>0)
+                {
+                    int read = in.read();
+                    if( read == '~')
+                    {
+                        nextChunkReady=NextChunkAction.CONTINUE;
+                    }
+                    if(read == '<')
+                    {
+                        nextChunkReady=NextChunkAction.REPEAT;
+                    }
+                }
+            }
+        }
+        catch (Exception e) { e.printStackTrace(); }
+        comPort.closePort();
+    }
+}

+ 82 - 0
QuickStuff/src/main/java/QuickVerifyCrap/WURestoreZuzel.java

@@ -0,0 +1,82 @@
+package QuickVerifyCrap;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+
+public class WURestoreZuzel {
+    static String updatesearchmagic = "<SOAP:Envelope xmlns:SOAP=\"x-schema:http://schemas.xmlsoap.org/soap/envelope/\"><SOAP:Body><GetManifest><clientInfo xmlns=\"x-schema:http://schemas.windowsupdate.com/iu/clientInfo.xml\" clientName=\"IU_Site\"/><systemInfo xmlns=\"x-schema:http://schemas.windowsupdate.com/iu/systeminfoschema.xml\"><computerSystem xmlns=\"\" manufacturer=\"VMware, Inc.\" model=\"VMware Virtual Platform\" supportSite=\"\" administrator=\"1\"><driveSpace drive=\"c:\\\" kbytes=\"125047488\"/></computerSystem><platform xmlns=\"\" name=\"VER_PLATFORM_WIN32_WINDOWS\"><processorArchitecture>x86</processorArchitecture><version major=\"4\" minor=\"10\" build=\"2222\" servicePackMajor=\"0\" servicePackMinor=\"0\"/></platform><locale xmlns=\"\" context=\"OS\"><language>de</language></locale><locale xmlns=\"\" context=\"USER\"><language>de</language></locale></systemInfo><query href=\"http://v4.windowsupdaterestored.com/getmanifest.asp\"><dObjQueryV1 procedure=\"Items\"><parentItems><item>win98se.windows98andwindows98secondedition</item></parentItems></dObjQueryV1></query></GetManifest></SOAP:Body></SOAP:Envelope>\n";
+    static String fileidmagic = "<SOAP:Envelope xmlns:SOAP=\"x-schema:http://schemas.xmlsoap.org/soap/envelope/\"><SOAP:Body><GetManifest><clientInfo xmlns=\"x-schema:http://schemas.windowsupdate.com/iu/clientInfo.xml\" clientName=\"IU_Site\"/><systemInfo xmlns=\"x-schema:http://schemas.windowsupdate.com/iu/systeminfoschema.xml\"><computerSystem xmlns=\"\" manufacturer=\"VMware, Inc.\" model=\"VMware Virtual Platform\" supportSite=\"\" administrator=\"1\"><driveSpace drive=\"c:\\\" kbytes=\"125042400\"/></computerSystem><platform xmlns=\"\" name=\"VER_PLATFORM_WIN32_WINDOWS\"><processorArchitecture>x86</processorArchitecture><version major=\"4\" minor=\"10\" build=\"2222\" servicePackMajor=\"0\" servicePackMinor=\"0\"/></platform><locale xmlns=\"\" context=\"OS\"><language>de</language></locale><locale xmlns=\"\" context=\"USER\"><language>de</language></locale></systemInfo><query href=\"http://v4.windowsupdaterestored.com/getmanifest.asp\"><dObjQueryV1 procedure=\"Installation\"><parentItems><item>########</item></parentItems></dObjQueryV1></query></GetManifest></SOAP:Body></SOAP:Envelope>\n";
+    public static void main(String[] args) throws IOException {
+        HttpClient httpclient = HttpClients.createDefault();
+        HttpPost httppost = new HttpPost("http://v4.windowsupdaterestored.com/getmanifest.asp");
+        httppost.setHeader("Content-Type","text/xml");
+        httppost.setHeader("Accept-Language","de");
+        httppost.setHeader("User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)");
+// Request parameters and other properties.
+        httppost.setEntity(new StringEntity(updatesearchmagic));
+
+//Execute and get the response.
+        HttpResponse response = httpclient.execute(httppost);
+        HttpEntity entity = response.getEntity();
+
+        if (entity != null) {
+            try (InputStream instream = entity.getContent()) {
+                BufferedReader r = new BufferedReader(new InputStreamReader(instream));
+                String muschipilze = r.readLine();
+                muschipilze = muschipilze.replace("<","<\n");
+                String[] zilsItHarder = muschipilze.split("\n");
+                for (String zilsme:
+                     zilsItHarder) {
+                    if(zilsme.contains("win98se.windows"))
+                    {
+                        String suckleItHarder = zilsme.split("\"")[1];
+                        String pullxml = fileidmagic.replace("########",suckleItHarder);
+
+                        httppost = new HttpPost("http://v4.windowsupdaterestored.com/getmanifest.asp");
+                        httppost.setHeader("Content-Type","text/xml");
+                        httppost.setHeader("Accept-Language","de");
+                        httppost.setHeader("User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)");
+// Request parameters and other properties.
+                        httppost.setEntity(new StringEntity(pullxml));
+
+//Execute and get the response.
+                        response = httpclient.execute(httppost);
+                        entity = response.getEntity();
+
+                        if (entity != null) {
+                            try (InputStream instream2 = entity.getContent()) {
+                                BufferedReader r2 = new BufferedReader(new InputStreamReader(instream2));
+                                String muschipilze2 = r2.readLine();
+                                muschipilze2 = muschipilze2.replace("<","<\n");
+                                String[] filezilser = muschipilze2.split("\n");
+                                for (String files:filezilser)
+                                {
+                                    if(files.contains("CabPool")&&files.contains("codeBase"))
+                                    {
+                                        //System.out.println(files);
+                                        System.out.println(files.split("\"")[1]);
+                                    }
+                                }
+
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 2 - 2
iZpl/src/main/java/de/nplusc/izc/iZpl/API/PlayListEditAPI.java

@@ -117,8 +117,8 @@ public class PlayListEditAPI
                     }
                     else
                     {                                                   //denk an die API oder es hagelt mysteryerrors
-                        String t1=((SinglePlayListItem)o1).getTitle().split(",")[1].trim();
-                        String t2=((SinglePlayListItem)o2).getTitle().split(",")[1].trim();
+                        String t1=o1.getTitle().split(",")[1].trim();
+                        String t2=o2.getTitle().split(",")[1].trim();
                         int r=t1.compareToIgnoreCase(t2);
                         r=r>0?1:r<0?-1:0;
                         l.trace("Sorter: single_single:"+r+"\ncomparing"+t1+" and "+t2+"\n");

+ 5 - 0
iZplPlugins/Editor/src/main/java/de/nplusc/izc/izpl/plugins/editor/Editor.java

@@ -25,6 +25,7 @@ import de.nplusc.izc.iZpl.API.shared.SinglePlayListItem;
 import de.nplusc.izc.tools.baseTools.Tools;
 import net.java.truevfs.access.TFile;
 import java.awt.EventQueue;
+import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -183,6 +184,10 @@ public class Editor implements FeaturePlugin
         
         List<SinglePlayListItem> data = IZPLApi.readPlayList(path);
         PlayListFile f = new PlayListFile();
+        if(new File(path).isDirectory())
+        {
+            f.setSynthetic(true);
+        }
         f.setPath(path);
         f.setEntries(data);
         lookupCache.put(path, f);

+ 118 - 108
izpl-shared/src/main/java/de/nplusc/izc/iZpl/API/shared/PlayListFile.java

@@ -1,109 +1,119 @@
-/*
- * Copyright (C) 2015 iZc
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package de.nplusc.izc.iZpl.API.shared;
-
-import java.util.List;
-import java.util.Objects;
-
-/**
- *
- * @author iZc <nplusc.de>
- */
-public class PlayListFile
-{
-    private List<SinglePlayListItem> entries;
-    
-    private int calculatedBasePriority=1;
-
-    public int getCalculatedBasePriority()
-    {
-        return calculatedBasePriority;
-    }
-
-    public void setCalculatedBasePriority(int calculatedBasePriority)
-    {
-        this.calculatedBasePriority = calculatedBasePriority;
-    }
-    
-    
-    public List<SinglePlayListItem> getEntries()
-    {
-        return entries;
-    }
-
-    public void setEntries(List<SinglePlayListItem> entries)
-    {
-        this.entries = entries;
-    }
-
-    public String getPath()
-    {
-        return path;
-    }
-
-    public void setPath(String path)
-    {
-        this.path = path;
-    }
-    private String path;
-
-    @Override
-    public int hashCode()
-    {
-        int hash = 3;
-        //hash = 41 * hash + Objects.hashCode(this.entries);// fickdich, du funkst beim rumfuhrwerken an den daten beim edit rein
-        hash = 41 * hash + Objects.hashCode(this.path);
-        return hash;
-    }
-
-    @Override
-    public boolean equals(Object obj)
-    {
-        if (obj == null)
-        {
-            return false;
-        }
-        if (getClass() != obj.getClass())
-        {
-            return false;
-        }
-        final PlayListFile other = (PlayListFile) obj;
-        if (!Objects.equals(this.entries, other.entries))
-        {
-            return false;
-        }
-        if (!Objects.equals(this.path, other.path))
-        {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public String toString()
-    {
-        return "PlayListFile{" + "calculatedBasePriority=" + calculatedBasePriority + ", path=" + path + '}';
-    }
-    
-    public String[] getSuffix()
-    {
-        return new String[]{};
-    }
-    
-    
+/*
+ * Copyright (C) 2015 iZc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package de.nplusc.izc.iZpl.API.shared;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ *
+ * @author iZc <nplusc.de>
+ */
+public class PlayListFile
+{
+    private List<SinglePlayListItem> entries;
+    
+    private int calculatedBasePriority=1;
+
+    public int getCalculatedBasePriority()
+    {
+        return calculatedBasePriority;
+    }
+
+
+
+    private boolean synthetic = false;
+
+    public void setCalculatedBasePriority(int calculatedBasePriority)
+    {
+        this.calculatedBasePriority = calculatedBasePriority;
+    }
+    
+    
+    public List<SinglePlayListItem> getEntries()
+    {
+        return entries;
+    }
+
+    public void setEntries(List<SinglePlayListItem> entries)
+    {
+        this.entries = entries;
+    }
+
+    public String getPath()
+    {
+        return path;
+    }
+
+    public void setPath(String path)
+    {
+        this.path = path;
+    }
+    private String path;
+
+    @Override
+    public int hashCode()
+    {
+        int hash = 3;
+        //hash = 41 * hash + Objects.hashCode(this.entries);// fickdich, du funkst beim rumfuhrwerken an den daten beim edit rein
+        hash = 41 * hash + Objects.hashCode(this.path);
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (obj == null)
+        {
+            return false;
+        }
+        if (getClass() != obj.getClass())
+        {
+            return false;
+        }
+        final PlayListFile other = (PlayListFile) obj;
+        if (!Objects.equals(this.entries, other.entries))
+        {
+            return false;
+        }
+        if (!Objects.equals(this.path, other.path))
+        {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString()
+    {
+        return "PlayListFile{" + "calculatedBasePriority=" + calculatedBasePriority + ", path=" + path + '}';
+    }
+    
+    public String[] getSuffix()
+    {
+        return new String[]{};
+    }
+
+    public boolean isSynthetic() {
+        return synthetic;
+    }
+
+    public void setSynthetic(boolean synthetic) {
+        this.synthetic = synthetic;
+    }
 }

+ 70 - 59
izpl-shared/src/main/java/de/nplusc/izc/iZpl/API/shared/RawPlayListFile.java

@@ -1,59 +1,70 @@
-/*
- * Copyright (C) 2015 iZc
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package de.nplusc.izc.iZpl.API.shared;
-
-import java.util.List;
-
-/**
- *
- * @author iZc <nplusc.de>
- */
-public class RawPlayListFile
-{
-    private String[] suffix;
-    
-    private String rootPath;
-    private List<SinglePlayListItem> data;
-
-    public RawPlayListFile(String rootPath, List<SinglePlayListItem> data)
-    {
-        this.rootPath = rootPath;
-        this.data = data;
-        suffix = new String[]{};
-    }
-    
-    public RawPlayListFile(String rootPath, List<SinglePlayListItem> data,String[] suffix)
-    {
-        this.rootPath = rootPath;
-        this.data = data;
-        this.suffix=suffix;
-    }
-    
-    public String getRootPath()
-    {
-        return rootPath;
-    }
-
-    public List<SinglePlayListItem> getData()
-    {
-        return data;
-    }
-    public String[] getSuffix()
-    {
-        return suffix;
-    }
-}
+/*
+ * Copyright (C) 2015 iZc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package de.nplusc.izc.iZpl.API.shared;
+
+import java.util.List;
+
+/**
+ *
+ * @author iZc <nplusc.de>
+ */
+public class RawPlayListFile
+{
+    private String[] suffix;
+    
+    private String rootPath;
+    private List<SinglePlayListItem> data;
+
+    public RawPlayListFile(String rootPath, List<SinglePlayListItem> data)
+    {
+        this.rootPath = rootPath;
+        this.data = data;
+        suffix = new String[]{};
+    }
+    
+    public RawPlayListFile(String rootPath, List<SinglePlayListItem> data,String[] suffix)
+    {
+        this.rootPath = rootPath;
+        this.data = data;
+        this.suffix=suffix;
+    }
+    
+    public String getRootPath()
+    {
+        return rootPath;
+    }
+
+    public List<SinglePlayListItem> getData()
+    {
+        return data;
+    }
+    public String[] getSuffix()
+    {
+        return suffix;
+    }
+
+    private boolean synthetic = false;
+
+    public boolean isSynthetic() {
+        return synthetic;
+    }
+
+    public void setSynthetic(boolean synthetic) {
+        this.synthetic = synthetic;
+    }
+
+}

+ 13 - 4
izpl-shared/src/main/java/de/nplusc/izc/iZpl/Utils/shared/PLFileIO.java

@@ -32,6 +32,7 @@ import java.io.InputStreamReader;
 import java.io.RandomAccessFile;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -106,7 +107,9 @@ public class PLFileIO
             }
             
         }
-        return new RawPlayListFile(path, virtualList);
+        RawPlayListFile rpl =  new RawPlayListFile(path, virtualList);
+        rpl.setSynthetic(true);
+        return rpl;
     }
     
     
@@ -483,6 +486,12 @@ public class PLFileIO
     
     public static void writePLFile(PlayListFile f)
     {
+        if(f.isSynthetic())
+        {
+            l.info("can't save a synthetic file");
+            l.info("file: "+f.getPath());
+            return;
+        }
         // Arbeit mit derPath-Klasse & der File.getPath() methode, Reflection dient zur Kompatibilität mitSystemen ohne dieser Klasse (wie Androiden)
         try{
             boolean supportinRelativeness=false;
@@ -515,7 +524,7 @@ public class PLFileIO
                     if(supportinRelativeness)
                     {
                         Method rel=pathclass.getMethod("relativize", (Class)pathclass);
-                        File current = new File(pathOfFile);
+                        File current = new File(pathOfFile).getCanonicalFile();
                         Object pa = pfadheraberdalli.invoke(current);
                         l.trace("pa-Class:"+pa.getClass());
                         Object figgdi = rel.invoke(basepath, pa);
@@ -523,7 +532,7 @@ public class PLFileIO
                         pathOfFile=figgdi+"";
                     }
                            // = p.relativize(new File().toPath()).toString();
-
+                    pathOfFile=pathOfFile.replace("\\","/"); //windoze-pfade umlegen
 
                     if(pli.isIncludeElement())
                     {
@@ -536,7 +545,7 @@ public class PLFileIO
                 }
                 RandomAccessFile file = new RandomAccessFile(fp, "rw");
                 file.setLength(0);
-                file.write(pld.getBytes());
+                file.write(pld.getBytes(Charset.forName("utf8")));
                 file.close();
             }
             catch (IOException ex)