Skip to content

Commit 2fcb0dd

Browse files
committed
Merge branch 'release/3.1.0'
hinzugefuegt: GZIP für ZDF-Crawler closed #139
2 parents a423e47 + 9c70f44 commit 2fcb0dd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ apply from: "${project.rootDir}/gradle/eclipse.gradle"
1515
sourceCompatibility = 1.8
1616
targetCompatibility = 1.8
1717
group = 'de.mediathekview'
18-
version = '3.0.11'
18+
version = '3.1.0'
1919

2020
def jarName = 'MServer.jar'
2121
def mainClass = 'mServer.Main'

src/main/java/mServer/crawler/sender/newsearch/ZDFClient.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.sun.jersey.api.client.Client;
99
import com.sun.jersey.api.client.ClientResponse;
1010
import com.sun.jersey.api.client.WebResource;
11+
import com.sun.jersey.api.client.filter.GZIPContentEncodingFilter;
1112

1213
import de.mediathekview.mlib.Const;
1314
import de.mediathekview.mlib.tool.Log;
@@ -53,6 +54,7 @@ public class ZDFClient {
5354

5455
public ZDFClient() {
5556
client = Client.create();
57+
client.addFilter(new GZIPContentEncodingFilter(true));
5658
gson = new Gson();
5759
}
5860

@@ -124,12 +126,11 @@ private String loadApiTokenVideos() {
124126
private JsonObject handleOk(ClientResponse response) {
125127
increment(RunSender.Count.ANZAHL);
126128

127-
String jsonOutput = response.getEntity(String.class);
128-
129-
long bytes = jsonOutput.length();
129+
long bytes = response.getLength();
130130
increment(RunSender.Count.SUM_DATA_BYTE, bytes);
131131
increment(RunSender.Count.SUM_TRAFFIC_BYTE, bytes);
132132

133+
String jsonOutput = response.getEntity(String.class);
133134
return gson.fromJson(jsonOutput, JsonObject.class);
134135
}
135136

0 commit comments

Comments
 (0)