1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-17 23:05:03 -05:00
filebot/source/net/sourceforge/filebot/web/SubsceneSubtitleDescriptor.java
Reinhard Pointner 73273b8b5b * refactoring
2009-05-21 10:00:48 +00:00

65 lines
1.2 KiB
Java

package net.sourceforge.filebot.web;
import java.net.URL;
import java.util.Collections;
import net.sourceforge.tuned.DownloadTask;
public class SubsceneSubtitleDescriptor implements SubtitleDescriptor {
private final String title;
private final String language;
private final String archiveType;
private final URL downloadLink;
private final URL referer;
public SubsceneSubtitleDescriptor(String title, String language, String archiveType, URL downloadLink, URL referer) {
this.title = title;
this.language = language;
this.archiveType = archiveType;
this.downloadLink = downloadLink;
this.referer = referer;
}
@Override
public String getName() {
return title;
}
public String getLanguageName() {
return language;
}
@Override
public DownloadTask createDownloadTask() {
DownloadTask downloadTask = new DownloadTask(downloadLink);
downloadTask.setRequestHeaders(Collections.singletonMap("Referer", referer.toString()));
return downloadTask;
}
@Override
public String getArchiveType() {
return archiveType;
}
@Override
public String toString() {
return String.format("%s [%s]", getName(), getLanguageName());
}
}