买了佳能打印机后,才发现有这个网站。上面资源不错,收集下做个采集分析。

网址无特殊说明,请求方式均为 get

页面数据提取

网站交互数据大部分是异步 xml,下面也主要找 xml 的数据。

所有分类数据

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <categories>
        <category>
            <id>CAT-ST01-0071</id>
            <name>纸模型</name>
            <count>787</count>
            <second_categories>
                <second_category>
                    <second_id>CAT-ST01-0083</second_id>
                    <second_name>智育</second_name>
                    <second_count>123</second_count>
                    <third_categories>
                        <third_category>
                            <third_id>CAT-ST01-5437</third_id>
                            <third_name>学习</third_name>
                            <third_count>40</third_count>
                        </third_category>
                       ... ...
                    </third_categories>
                </second_category>
       ... ...
        </category>
    </categories>
</root>

分类下所有的内容

内容标题,内容缩略图,所属分类

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <categories cate="1">
        <contents>
            <content>
                <![CDATA[
                <div class="categoryContents" title="分数拼图: 水果">
                    <div class="categoryContentsWrapper CNT-0026566" id="CNT-0026566">
                        <a href="/sc/contents/CNT-0026566/index.html"></a>
                        <img src="" srcset="/images/contents/CNT-0026566/CNT-0026566_sp.jpg 1x, /images/contents/CNT-0026566/CNT-0026566_sp.jpg 2x"
                            data-img="/images/contents/CNT-0026566/CNT-0026566_sp.jpg"
                            data-img_sp="/images/contents/CNT-0026566/CNT-0026566.jpg"
                            data-set_sp="/images/contents/CNT-0026566/CNT-0026566.jpg 1x, /images/contents/CNT-0026566/CNT-0026566@2x.jpg 2x, /images/contents/CNT-0026566/CNT-0026566@2x.jpg 3x" />
                        <div class="canonId">
                            <img class="canonId_CNT-0026566" src="/common3/images/canonid_s@1x.png" srcset="/common3/images/canonid_s@1x.png 1x, /common3/images/canonid_l@2x.png 2x, /common3/images/canonid_s@3x.png 3x"/>
                        </div>
                        <div class="contentsName">分数拼图: 水果</div>
                        <div class="categoryName">学习</div>
                        <div class="colorChip">
                        </div>
                    </div>
                </div>
                ]]>
            </content>
        </contents>
        ......
        
    </categories>
</root>

内容基础信息

<table class="upper">
                        <tbody><tr>
                            <td class="layoutArea" style="width: 520px;">
                                <div class="preview">
                                    <img id="previewImg" src="/images/contents/CNT-0010841/CNT-0010841_detail-01_m@2x.jpg" title="" alt="长戟大兜虫,科学,纸模型,美国,虫子,独角仙">
                                    <a class="canonIdLink" href="#" target="new"><img class="canonId" src="/common3/images/canonid_l@1x.png" srcset="/common3/images/canonid_l@1x.png 1x, /common3/images/canonid_l@2x.png 2x, /common3/images/canonid_l@3x.png 3x"></a>
                                </div>
                                <div class="thumbnailArea">
                                    <div class="thumbnail thumbnailSelect" onclick="detailPreviewChange(this)">
                                        <img src="/images/contents/CNT-0010841/CNT-0010841_detail-01.jpg" srcset="/images/contents/CNT-0010841/CNT-0010841_detail-01.jpg 1x, /images/contents/CNT-0010841/CNT-0010841_detail-01@2x.jpg 2x" data-img="/images/contents/CNT-0010841/CNT-0010841_detail-01.jpg">
                                        <input type="hidden" class="s1" value="/images/contents/CNT-0010841/CNT-0010841_detail-01_s.jpg">
                                        <input type="hidden" class="s2" value="/images/contents/CNT-0010841/CNT-0010841_detail-01_s@2x.jpg">
                                        <input type="hidden" class="s3" value="/images/contents/CNT-0010841/CNT-0010841_detail-01_s@2x.jpg">
                                        <input type="hidden" class="m1" value="/images/contents/CNT-0010841/CNT-0010841_detail-01_m.jpg">
                                        <input type="hidden" class="m2" value="/images/contents/CNT-0010841/CNT-0010841_detail-01_m@2x.jpg">
                                        <input type="hidden" class="m3" value="/images/contents/CNT-0010841/CNT-0010841_detail-01_m@2x.jpg">
                                        <input type="hidden" class="l1" value="/images/contents/CNT-0010841/CNT-0010841_detail-01_m@2x.jpg">
                                        <input type="hidden" class="l2" value="/images/contents/CNT-0010841/CNT-0010841_detail-01_m@2x.jpg">
                                        <input type="hidden" class="l3" value="/images/contents/CNT-0010841/CNT-0010841_detail-01_m@2x.jpg">
                                    </div>
                                </div>
                            </td>
                            <td class="blankInfoArea"></td>
                            <td class="infoArea" style="width: 600px;">
                                <h1 class="contentsTitle">长戟大兜虫</h1>
                                <div class="infoItem">
                                    <div class="artistSearch">
                                        <div class="set">
                                            <a href="" onclick="searchArtist('Y.Watanabe'); return false;">
                                                <div class="item nocontent">艺术家:</div>
                                                <h2 class="text">Y.Watanabe</h2>
                                                <div class="icon"></div>
                                            </a>
                                        </div>
                                    </div>
                                    <div class="floatClear"></div>
                                </div>
                                <form name="pcForm">
                                    <div class="infoItem" id="pcMediaArea">
                                        <div class="infoTitle nocontent">纸张尺寸</div>
                                        <div class="pcSelectBase" style="width: 100%; height: 40px; min-width: 0px;"><div class="selectL selectImgL40"></div><div id="selectText-pcMedia" class="selectC selectImgC40">A4</div><div class="selectR selectImgR40"></div></div><div class="selectOpen floatL forPc mCustomScrollbar _mCS_6 mCS-autoHide mCS_no_scrollbar" style="overflow: visible; width: 600px; display: none;"><div id="mCSB_6" class="mCustomScrollBox mCS-minimal mCSB_vertical mCSB_outside" tabindex="0"><div id="mCSB_6_container" class="mCSB_container mCS_y_hidden mCS_no_scrollbar_y" style="position:relative; top:0; left:0;" dir="ltr"><div class="pulldownItem"><label class="pulldownItemSelected">A4<input type="hidden" value="../CNT-0010841/index.html"></label></div><div class="pulldownItem"><label>Letter 8.5"x11" 22x28cm<input type="hidden" value="../CNT-0010842/index.html"></label></div></div></div><div id="mCSB_6_scrollbar_vertical" class="mCSB_scrollTools mCSB_6_scrollbar mCS-minimal mCSB_scrollTools_vertical" style="display: none;"><div class="mCSB_draggerContainer"><div id="mCSB_6_dragger_vertical" class="mCSB_dragger" style="position: absolute; min-height: 50px; top: 0px; height: 0px;" oncontextmenu="return false;"><div class="mCSB_dragger_bar" style="line-height: 50px;"></div></div><div class="mCSB_draggerRail"></div></div></div></div><select id="pcMedia" name="pcMediaList" width="100%" height="40px" onchange="jumpPcMedia()" style="display: none;"><option value="../CNT-0010841/index.html" selected="">A4</option><option value="../CNT-0010842/index.html">Letter 8.5"x11" 22x28cm</option></select>
                                    </div>
                                    <div class="infoItem" id="pcGroup1Area" style="display: none;">
                                        <div class="infoTitle nocontent" id="pcGroup1Name"></div>
                                        <div class="pcSelectBase" style="width: 100%; height: 40px; min-width: 0px;"><div class="selectL selectImgL40"></div><div id="selectText-pcGroup1" class="selectC selectImgC40">undefined</div><div class="selectR selectImgR40"></div></div><div class="selectOpen floatL forPc mCustomScrollbar _mCS_7 mCS-autoHide mCS_no_scrollbar" style="overflow: visible; width: 100px; display: none;"><div id="mCSB_7" class="mCustomScrollBox mCS-minimal mCSB_vertical mCSB_outside" tabindex="0"><div id="mCSB_7_container" class="mCSB_container mCS_y_hidden mCS_no_scrollbar_y" style="position:relative; top:0; left:0;" dir="ltr"></div></div><div id="mCSB_7_scrollbar_vertical" class="mCSB_scrollTools mCSB_7_scrollbar mCS-minimal mCSB_scrollTools_vertical" style="display: none;"><div class="mCSB_draggerContainer"><div id="mCSB_7_dragger_vertical" class="mCSB_dragger" style="position: absolute; min-height: 50px; top: 0px;" oncontextmenu="return false;"><div class="mCSB_dragger_bar" style="line-height: 50px;"></div></div><div class="mCSB_draggerRail"></div></div></div></div><select id="pcGroup1" name="pcGroup1List" width="100%" height="40px" onchange="jumpPcGroup1()" style="display: none;"></select>
                                    </div>
                                    <div class="infoItem" id="pcGroup2Area" style="display: none;">
                                        <div class="infoTitle nocontent" id="pcGroup2Name"></div>
                                        <div class="pcSelectBase" style="width: 100%; height: 40px; min-width: 0px;"><div class="selectL selectImgL40"></div><div id="selectText-pcGroup2" class="selectC selectImgC40">undefined</div><div class="selectR selectImgR40"></div></div><div class="selectOpen floatL forPc mCustomScrollbar _mCS_8 mCS-autoHide mCS_no_scrollbar" style="overflow: visible; width: 100px; display: none;"><div id="mCSB_8" class="mCustomScrollBox mCS-minimal mCSB_vertical mCSB_outside" tabindex="0"><div id="mCSB_8_container" class="mCSB_container mCS_y_hidden mCS_no_scrollbar_y" style="position:relative; top:0; left:0;" dir="ltr"></div></div><div id="mCSB_8_scrollbar_vertical" class="mCSB_scrollTools mCSB_8_scrollbar mCS-minimal mCSB_scrollTools_vertical" style="display: none;"><div class="mCSB_draggerContainer"><div id="mCSB_8_dragger_vertical" class="mCSB_dragger" style="position: absolute; min-height: 50px; top: 0px;" oncontextmenu="return false;"><div class="mCSB_dragger_bar" style="line-height: 50px;"></div></div><div class="mCSB_draggerRail"></div></div></div></div><select id="pcGroup2" name="pcGroup2List" width="100%" height="40px" onchange="jumpPcGroup2()" style="display: none;"></select>
                                    </div>
                                </form>
                                <div class="colorInfo" style="display: none;">
                                    <div class="infoTitle nocontent">颜色</div>
                                    <span id="pcColorArea"></span>
                                </div>
                                <div class="infoItem nocontent">
                                    <div class="downloadArea">
                                        <div class="downloadBtn">
                                            <div class="materialDownload" onclick="download('CNT-0010841-01.pdf', true)">
                                                <div>
                                                    <table>
                                                        <tbody>
                                                            <tr>
                                                                <td>
                                                                    <img src="/common3/images/btn-download.png" data-img="/common3/images/btn-download.png">
                                                                </td>
                                                                <td>
                                                                    <label class="materialDownloadStr">下载</label>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="downloadAccompaniment">
                                                    页数: 8
                                                (3.5MB)
                                            </div>
                                        </div>
                                        <div class="downloadBtn">
                                            <div class="recipeDownload" rel="#pcEula01" onclick="download('CNT-0010841-02.pdf', false);">
                                                <div>
                                                    <table>
                                                        <tbody>
                                                            <tr>
                                                                <td>
                                                                    <img src="/common3/images/btn-assembly_instructions.png" data-img="/common3/images/btn-assembly_instructions.png">
                                                                </td>
                                                                <td>
                                                                    <label>说明</label>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="downloadAccompaniment">
                                                    页数: 5
                                                (649KB)
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="floatClear"></div>
                                <div class="infoItem">
                                    <div id="pcDetailTitle" class="detailInfoTitle nocontent infoOpen" onclick="detailClick()">内容信息</div>
                                    <div id="pcDetailInfo" class="detailInfo">
                                        <div class="detailRow">
                                            <div class="detailColH nocontent">发布日期</div>
                                            <div class="detailCol">2008-09-19</div>
                                        </div>
                                        <div class="detailRow">
                                            <div class="detailColH nocontent">打印质量</div>
                                            <div class="detailCol">高</div>
                                        </div>
                                        <div class="detailRow">
                                            <div class="detailColH nocontent">推荐的纸张类型</div>
                                            <div class="detailCol">Matte</div>
                                        </div>
                                        <div class="detailRow">
                                            <div class="detailColH nocontent">方向</div>
                                            <div class="detailCol">水平</div>
                                        </div>
                                        <div class="detailRow">
                                            <div class="detailColH nocontent">页面布局</div>
                                            <div class="detailCol">有边距</div>
                                        </div>
                                        <div class="detailRow">
                                            <div class="detailColH nocontent">页面比例</div>
                                            <div class="detailCol">无</div>
                                        </div>
                                    </div>
                                </div>
                                <div class="supplement"></div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" class="blankLayout">
                            </td>
                        </tr>
                    </tbody></table>

获取支持文件列表

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <formSize>
        <item isOwn="true">
            <value>A4/Letter 8.5&quot;x11&quot; 22x28cm</value>
            <contentsId>CNT-0023245</contentsId>
        </item>
    </formSize>
</root>


<?xml version="1.0" encoding="UTF-8"?>
<root>
    <formSize>
        <item isOwn="false">
            <value>A4</value>
            <contentsId>CNT-0010841</contentsId>
        </item>
        <item isOwn="true">
            <value>Letter 8.5&quot;x11&quot; 22x28cm</value>
            <contentsId>CNT-0010842</contentsId>
        </item>
    </formSize>
</root>

下载文件

请求方式: POST
请求参数:langCode=sc&contentsId=CNT-0010842&fileId=CNT-0010842-02.pdf&isParts=false
文件下载有防盗链 通过POST请求https://creativepark.canon/cpark/download.do 设置 cookie CPDLRD。并 location 跳转到文件地址。

分析

curl 'https://creativepark.canon/cpark/download.do' 
-H 'authority: creativepark.canon' 
-H 'pragma: no-cache' 
-H 'cache-control: no-cache' 
-H 'origin: https://creativepark.canon' 
-H 'upgrade-insecure-requests: 1' 
-H 'dnt: 1' 
-H 'content-type: application/x-www-form-urlencoded' 
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36' 
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3' 
-H 'referer: https://creativepark.canon/sc/contents/CNT-0010842/index.html' 
-H 'accept-encoding: gzip, deflate, br' 
-H 'accept-language: zh-CN,zh;q=0.9,en;q=0.8' 
-H 'cookie: _ga=GA1.2.884268572.1562334078; _gid=GA1.2.306487664.1564821889; CPDLAG-01=1; CPDLRD=C3BF888ABAB47FF433B5BB21EC6B43580E7310C80B28C211FCA63F0CDDFFE461; _gat=1' 
--data 'langCode=sc&contentsId=CNT-0010842&fileId=CNT-0010842-02.pdf&isParts=false' 
--compressed


curl 'https://creativepark.canon/downloads/contents/CNT-0010842/CNT-0010842-02.pdf' 
-H 'authority: creativepark.canon' 
-H 'pragma: no-cache' 
-H 'cache-control: no-cache' 
-H 'upgrade-insecure-requests: 1' 
-H 'dnt: 1' 
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36' 
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3' 
-H 'referer: https://creativepark.canon/sc/contents/CNT-0010842/index.html' 
-H 'accept-encoding: gzip, deflate, br' 
-H 'accept-language: zh-CN,zh;q=0.9,en;q=0.8' 
-H 'cookie: _ga=GA1.2.884268572.1562334078; _gid=GA1.2.306487664.1564821889; CPDLAG-01=1; _gat=1; CPDLRD=275FB840640995A74CE47A549634572B53900E0DFA75AD63A07C88DF3C94A421' 
--compressed
  • 下载按钮相关 js
var COOKIE_EXPIRES = 7;
var _eula = null;
var _noEula = null;
var _isError = false;
var _eulaLoaded = false;
$(window).load(function() {
    if (isPC()) {
        _eula = "#pcEula";
        _noEula = "#pcNoEula"
    } else {
        _eula = "#spEula";
        _noEula = "#spNoEula"
    }
    var eula01xml = "";
    if (isStorage) {
        var lastModified = sessionStorage.getItem("Last-Modified:" + LANG_CODE + "/eula01.xml");
        if (lastModified == null) {
            lastModified = "Thu, 01 Jan 1970 00:00:00 GMT"
        }
    } else {
        var lastModified = "Thu, 01 Jan 1970 00:00:00 GMT"
    }
    var url = TOP_URL + "/" + LANG_CODE + "/eula/eula_01.xml";
    _isError = false;
    $.ajax({
        url: url,
        type: "get",
        dataType: "xml",
        timeout: 1e4,
        cache: true,
        headers: {
            "If-Modified-Since": lastModified
        }
    }).done(function(data, status, xhr) {
        if (xhr.status == 200) {
            eula01xml = $(data).find("message").text();
            if (isStorage) {
                lastModified = xhr.getResponseHeader("Last-Modified");
                sessionStorage.setItem("Last-Modified:" + LANG_CODE + "/eula01.xml", lastModified);
                sessionStorage.setItem(LANG_CODE + "/" + "eula01.xml", eula01xml)
            }
        }
        if (xhr.status === 304) {
            eula01xml = sessionStorage.getItem(LANG_CODE + "/" + "eula01.xml")
        }
        $(_eula + "Text").html(eula01xml);
        _eulaLoaded = true
    }).error(function() {
        _isError = true
    });
    var contentsId = document.getElementsByName("contentsId").item(0).content;
    if (!isCanonId(contentsId)) {
        return
    }
    $(".canonId").css("visibility", "visible");
    $(".canonIdLink").attr("href", "https://ugp01.c-ij.com/ij/webmanual/WebPortal/PTA/pta_cid.html?lng=" + LANG_CODE + "&type=non");
    if (checkCVC()) {
        return
    }
    var language = {
        jp: "ja-JP",
        en: "en-GB",
        fr: "fr-FR",
        de: "de-DE",
        it: "it-IT",
        es: "es-ES",
        pt: "pt-PT",
        nl: "nl-NL",
        pl: "pl-PL",
        ru: "ru-RU",
        tr: "tr-TR",
        sc: "zh-CN",
        ko: "ko-KR",
        th: "th-TH",
        id: "id-ID"
    };
    var aboutCanonId = {
        jp: "CanonIDについて",
        en: "What is Canon ID?",
        fr: "Qu'est-ce qu'un Canon ID ?",
        de: "Was ist Canon ID?",
        it: "Che cosa è il Canon ID?",
        es: "¿Qué es Canon ID?",
        pt: "O que é Canon ID?",
        nl: "Wat is Canon ID?",
        pl: "Co to jest Canon ID?",
        ru: "Что такое Canon ID?",
        tr: "Canon ID nedir?",
        sc: "什么是 Canon ID?",
        ko: "Canon ID란?",
        th: "Canon ID คืออะไร",
        id: "Apa itu Canon ID?"
    };
    var clientId = "03780a71-ec35-4b38-afd2-0e607b7ca054";
    var messageBot = "<a href='https://myid.canon/canonid/#/help' target='new' style='font-size: 20px'>" + aboutCanonId[LANG_CODE] + "</a>";
    var redirectUrl = TOP_URL + "/cpark/ccb-auth01.do";
    var endpoint = "https://myid.canon/canonid";
    widgetConfiguration = {
        clientID: clientId,
        messageBot: messageBot,
        redirectURL: redirectUrl,
        endpoint: endpoint,
        language: language[LANG_CODE],
        modal: true,
        embedded: true,
        returnBasicUserData: false,
        client_state: "CP",
        view: "login",
        scope: "openid"
    };
    cidWidget.configure(widgetConfiguration);
    var ownerState = $.cookie("OS01");
    if (ownerState == null) {
        return
    }
    if (ownerState.indexOf("READY") == -1) {
        $.cookie("OS01", "", {
            path: "/",
            expires: -1
        });
        return
    }
    if (sessionStorage.getItem("contentsId") == contentsId && $.cookie("OS01") != null) {
        var downloadFile = sessionStorage.getItem("downloadFile");
        var isParts = sessionStorage.getItem("isParts");
        sessionStorage.removeItem("contentsId");
        sessionStorage.removeItem("downloadFile");
        sessionStorage.removeItem("isParts");
        if ($.cookie("CPDLAG-01") == 1 && _isError == false) {
            downloadStart(downloadFile, isParts);
            return
        }
        if (_isError) {
            location.reload();
            return
        }
        $("#overlay").fadeIn();
        _downloadFile = downloadFile;
        _isParts = isParts;
        var interval = setInterval(function() {
            if (_eulaLoaded) {
                clearInterval(interval);
                adjustModalPosition();
                $(_eula).fadeIn()
            }
        },
        100)
    }
});
var _onClick = false;
var _downloadFile = "";
var _isParts = false;
function download(downloadFile, isParts) {
    var contentsId = document.getElementsByName("contentsId").item(0).content;
    if (isCanonId(contentsId) && isParts && checkCVC()) {
        window.open(TOP_URL + "/" + LANG_CODE + "/error/unavailable.html", "new");
        return
    }
    if (!isCanonId(contentsId) || isParts == false) {
        if ($.cookie("CPDLAG-01") == 1 && _isError == false) {
            downloadStart(downloadFile, isParts);
            return
        }
        if (_isError) {
            location.reload();
            return
        }
        adjustModalPosition();
        $("#overlay").fadeIn();
        $(_eula).fadeIn();
        _downloadFile = downloadFile;
        _isParts = isParts;
        return
    }
    if (_onClick == true) {
        return
    }
    _onClick = true;
    setTimeout(function() {
        _onClick = false
    },
    1e3);
    $.cookie("CB01", TOP_URL + "/" + LANG_CODE + "/contents/" + contentsId + "/index.html", {
        path: "/"
    });
    sessionStorage.setItem("contentsId", contentsId);
    sessionStorage.setItem("downloadFile", downloadFile);
    sessionStorage.setItem("isParts", isParts);
    displayEmbeddedLogin()
}
function adjustModalPosition() {
    var w = $(window).width();
    var h = $(window).height();
    var left = 0;
    var top = 0;
    if (isPC()) {
        if (w < 640) {
            left = 0
        } else {
            left = (w - 640) / 2
        }
        if (h < 640) {
            top = 0;
            $(".modal").height(h);
            $("#pcEulaText").height(h - 328)
        } else {
            top = (h - 640) / 2;
            $(".modal").height(640);
            $("#pcEulaText").height(312)
        }
    } else {
        var margin = 16;
        if (h < 500 + margin * 2) {
            $("#spEulaText .section").height(h - 226 - margin * 2)
        } else {
            $("#spEulaText .section").height(274)
        }
        $(_eula).width(w - margin * 2);
        var eulaW = $(_eula).width() + margin * 2;
        var eulaH = $(_eula).height() + margin * 2;
        left = (w - eulaW) / 2;
        top = (h - eulaH) / 2
    }
    $(_eula).css({
        left: left + "px"
    });
    $(_eula).css({
        top: top + "px"
    })
}
$(window).on("resize",
function() {
    adjustModalPosition()
});
function agree() {
    $(_eula).fadeOut();
    $("#overlay").fadeOut();
    if ($(_noEula).is(":checked")) {
        $.cookie("CPDLAG-01", "1", {
            path: "/",
            expires: COOKIE_EXPIRES
        })
    } else {
        $.cookie("CPDLAG-01", "1", {
            path: "/"
        })
    }
    downloadStart(_downloadFile, _isParts)
}
function deagree() {
    $(_eula).fadeOut();
    $("#overlay").fadeOut()
}
function pageJump(url) {
    $.cookie("CB01", url, {
        path: "/"
    });
    displayEmbeddedLogin(false)
}
function downloadStart(downloadFile, isParts) {
    var categoryId = document.getElementsByName("categoryId").item(0).content;
    var contentsId = document.getElementsByName("contentsId").item(0).content;
    //
    var downloadPath = TOP_URL + D_ROOT + "/downloads/contents/" + contentsId + "/" + downloadFile;
    var url = TOP_URL + D_ROOT + "/download.do";
    var action = LANG_CODE + "|" + contentsId + "|" + categoryId;
    var label = LANG_CODE + "|" + downloadPath;
    ga("send", "event", "download", action, label);
    var form = document.createElement("form");
    document.body.appendChild(form);
    var input = null;
    input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", "langCode");
    input.setAttribute("value", LANG_CODE);
    form.appendChild(input);
    input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", "contentsId");
    input.setAttribute("value", contentsId);
    form.appendChild(input);
    input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", "fileId");
    input.setAttribute("value", downloadFile);
    form.appendChild(input);
    input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", "isParts");
    input.setAttribute("value", isParts);
    form.appendChild(input);
    form.setAttribute("method", "post");
    if (!isPC()) {
        var userAgent = window.navigator.userAgent;
        if (userAgent.indexOf("iphone") != -1 || userAgent.indexOf("ipod") != -1 || userAgent.indexOf("ipad") != -1) {
            if (userAgent.indexOf("FBAN") == -1) {
                form.setAttribute("target", "_blank")
            }
        }
    }
    form.setAttribute("action", url);
    form.submit()
}
function displayEmbeddedLogin() {
    cidWidget.checkUserSession().then(function onResolve(response) {
        if (response.redirectUrl) {
            window.location = response.redirectUrl
        } else {
            cidWidget.display();
            cidWidget.checkSocialLoginError()
        }
    },
    function onReject(error) {
        console.log("something went wrong: ", error)
    })
}

点赞(0) 打赏

Comment list 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部