admin
2024-09-05 ab35ac8b769b2d9816dffb33a64f2c6f7bd5dd6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.yeshi.buwan.videos.funtv;
 
import java.io.UnsupportedEncodingException;
import java.util.List;
 
import com.yeshi.buwan.videos.funtv.vo.FunTVCartoonAlbum;
import com.yeshi.buwan.videos.funtv.vo.FunTVMovieVideo;
import com.yeshi.buwan.videos.funtv.vo.FunTVShortVideo;
import com.yeshi.buwan.videos.funtv.vo.FunTVShowAlbum;
import com.yeshi.buwan.videos.funtv.vo.FunTVTVAlbum;
import com.yeshi.buwan.util.HttpUtil;
 
public class FunTVApi {
    public static String FUNTV_ALL_MOVIE = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common_co_api/fun_common_movie_2501_all.xml";
    public static String FUNTV_ALL_TV = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common_co_api/fun_common_tv_2501_all.xml";
    public static String FUNTV_ALL_CARTON = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common_co_api/fun_common_cartoon_2501_all.xml";
    public static String FUNTV_ALL_SHOW = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common_co_api/fun_common_variety_2501_all.xml";
    public static String FUNTV_ALL_SHORTVIDEO = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common/fun_common_2501_all.xml";
 
    public static String FUNTV_UPDATE_MOVIE = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common_co_api/fun_common_movie_2501_update.xml";
    public static String FUNTV_UPDATE_TV = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common_co_api/fun_common_tv_2501_update.xml";
    public static String FUNTV_UPDATE_CARTON = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common_co_api/fun_common_cartoon_2501_update.xml";
    public static String FUNTV_UPDATE_SHOW = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common_co_api/fun_common_variety_2501_update.xml";
    public static String FUNTV_UPDATE_SHORTVIDEO = "http://www.fun.tv/attachment/editor/upload/open_xml/fun_common/fun_common_2501_update.xml";
 
    private static String httpGet(String url){
        if(url!=null){
            try {
                return new String(HttpUtil.defaultGet(url).getBytes("ISO-8859-1"),"UTF-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
        }
        return "";
    }
 
    public static List<String> getPageUrl(String type) {
        String result = HttpUtil.get(type);
        return FunTVDataParseUtil.parsePageUrl(result);
    }
 
    public static List<FunTVMovieVideo> parseMovie(String url) {
        String result =httpGet(url);
        return FunTVDataParseUtil.parseMovieListVideo(result);
    }
 
    public static List<FunTVShowAlbum> parseShow(String url) {
        String result = httpGet(url);
        return FunTVDataParseUtil.parseShowListVideo(result);
    }
 
    public static List<FunTVTVAlbum> parseTV(String url) {
        String result =httpGet(url);
        return FunTVDataParseUtil.parseTVListAlbum(result);
    }
 
    public static List<FunTVCartoonAlbum> parseCartoon(String url) {
        String result =httpGet(url);
        return FunTVDataParseUtil.parseCartoonListVideo(result);
    }
 
    public static List<FunTVShortVideo> parseShortVideo(String url) {
        String result = httpGet(url);
        return FunTVDataParseUtil.parseShortListVideo(result);
    }
}