Analysis bilibili file directory cache folder

A file type

  1. 1080P video content: m4s project

    (Media-type) type encoding: 2

    m4s project is bilibili storage of some of the larger or higher-resolution video files longer

    You can use ffmpeg to connect, I can also be used to develop a GUI version ( https://github.com/Holit/ffmpegLinker )

  2. Other content: blv project

    (Media-type) type encoding: 1

    blv fact, FLV file bilibili to change, you can use ffmpeg converter can also be directly called the expansion flv

    Further, such a sequence of video files 0.blv, 1.blv, 2.blv like represent the order of the sequence, you can combine these flv files in order of 0,1,2,3,4

    See also: https://www.littleqiu.net/archives/886

Second, the file directory Detailed

Android file cache location: the Data \ tv.danmaku.bili \ download \ ...
  1. series of documents

    \ list download \ s_ {id} \ { ep_id} \ sharpness information \ file [0 ~ N] .blv # playback file
                         index.json # data file
                    entry.json # file entry (see below)
                    danmuku.xml # barrage file

    Examples: \ download \ s_357 \ 249469 \ lua.flv480.bb2api.32 \ 0.blv ( cat and mouse (legacy) first episode, playing address: https://www.bilibili.com/bangumi/play / ep249469 )

  • {id} s_ series id: id indicates the localization position episodes, i.e. https://www.bilibili.com/bangumi/play/ss { id}
  • {ep_id} division number P: represents the number of the video file from a series id, i.e. https://www.bilibili.com/bangumi/play/ep { EP_ID}
  • Clarity of information:
    • Generally lua. {Type}. {Api} beginning
      • type: the type comprising video and clarity, such as flv / flv480
      • api: temporarily unclear
  • document list
    • Generally blv file
    • Sorting according 0.blv 1.blv other, represents a sequence of video

  2. Cache single-file
      \ download \ av No. \ 1 \ sharpness information \ vedio.m4s # m4s file
                      audio.m4s      
                      index.json data file #
                entry.json # entry file


Third, the file structure
1.index.json (corresponding to M4S)
original video: https: //www.bilibili.com/video/av80959848

{ " Video " : # video content of the message
    [
        {
            " ID " : 112 ,            
             " the base_url " : " HTTPS: \ / \ / upos-hz-mirrorks3u.acgvideo.com \ / upgcxcode \ / 07 \ / 48 \ / 138 564 807 \ /138564807-1-30112.m4s E =? ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8xNEVE5XREto8GuFGv2U7SuxI72X6fTr859IB_ & uipk =. 5 & NBS =. 1 & DEADLINE = 1,579,364,249 & Gen = playurl & OS = ks3u & OI = 3084983280 & TRID = dbd1c5a062ca4e59b6019c5a15522f4du & Platform = Android & upsig = 5ec2887544562b37b28841b7e0bab9ba & uparams = E, uipk, NBS, DEADLINE, Gen, OS, OI, TRID, Platform & MID = 68,089,222 " ,     
        # original video acquisition address, Note: direct access will lead to
403 Forbidden error "backup_url": [ "https:\/\/upos-sz-mirrorks3.bilivideo.com\/upgcxcode\/07\/48\/138564807\/138564807-1-30112.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8xNEVE5XREto8GuFGv2U7SuxI72X6fTr859IB_&uipk=5&nbs=1&deadline=1579364249&gen=playurl&os=ks3bv&oi=3084983280&trid=dbd1c5a062ca4e59b6019c5a15522f4du&platform=android&upsig=d2c5d34dcf612c4a00d6863a4036bf10&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,platform&mid=68089222"
        #备存的视频地址 ], " Bandwidth " : 5973795 , # Bandwidth " CodecID " : . 7 , " size " : 145 760 613 , # size, in bytes " MD5 " : " 58cbd8bc70f10f5ec708dfc06e37a83e " # the MD5 checksum } ], " Audio " : The audio content of the message # [ { "id":30280, "base_url":"https:\/\/upos-sz-mirrorhw.bilivideo.com\/upgcxcode\/07\/48\/138564807\/138564807_nb2-1-30280.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8xNEVE5XREto8GuFGv2U7SuxI72X6fTr859IB_&uipk=5&nbs=1&deadline=1579364249&gen=playurl&os=hwbv&oi=3084983280&trid=dbd1c5a062ca4e59b6019c5a15522f4du&platform=android&upsig=d787321f450cdbfa94d8e57da87c9412&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,platform&mid=68089222", "backup_url": [ "https:\/\/upos-sz-mirrorks3.bilivideo.com\/upgcxcode\/07\/48\/138564807\/138564807_nb2-1-30280.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8xNEVE5XREto8GuFGv2U7SuxI72X6fTr859IB_&uipk=5&nbs=1&deadline=1579364249&gen=playurl&os=ks3bv&oi=3084983280&trid=dbd1c5a062ca4e59b6019c5a15522f4du&platform=android&upsig=bf39193d876386e91d0ac1e7828204ea&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,platform&mid=68089222" ], "bandwidth":319160, "codecid":0, "size":7790910, "md5":"902911e36938be7a4fedc7b705fade34" } ] }

2.entry.json
original video: https: //www.bilibili.com/video/av80959848

{
     " MEDIA_TYPE " : 2 , # Media Type " has_dash_audio " : to true ,
     " is_completed " : to true , # download end
     " total_bytes " : 153 551 523 , # total size
     " downloaded_bytes " : 153 551 523 , # Size
     " title " : " [Korean small Mu × × Mummy t] in two unscientificのsuper shake a shoulder dance COINCIDANCE [] [] electron-positronのwonderful adventure " , # heading
     " type_tag " :"112 " ,
     " Cover " : " HTTP: \ / \ / i1.hdslb.com \ / bfs \ / Archive \ /381050f060f9a7c2c57e273ecf8e3758148cbc27.jpg " , " prefered_video_quality " : 112 , # Cover
     " guessed_total_bytes " : 0 ,
     " total_time_milli " : 195325 , the length of the video #, ms (milliseconds) units
     " danmaku_count " : 909 , the number of # barrage
     " time_update_stamp " : 1579357099610 ,
    # Update timestamp" Time_create_stamp " : 1,579,357,043,896 , # creation timestamp
     " Avid " : 80,959,848 , #av No.
     " SPID " : 0 ,
     " seasion_id " : 0 ,
     " page_data " : # page data (points P)
        {
        " CID " : 138 564 807 ,
         " Page " : . 1 ,
         " from " : " vupload " ,
         " Part " : " [t Korean small × Mu × mum in two scientificの] a super shoulder shaking dance [negative] [COINCIDANCE electronicのBizarre Adventure] " ,
         " VID " : " " ,
         " has_alias " : false ,
         " tid " : 124 ,
         "width":1920 , # width
         " height " : 1080 , # height
         " Rotate " : 0 , # rotation
         " DOWNLOAD_TITLE " : " Video cached completed " ,
         " download_subtitle " : " [Korean small Mu × mum t × in two] a scientificのsuper shoulder shaking dance] [[COINCIDANCE electron-positronのwonderful Adventure] 
                            [Korean small t × Mu × mum in two scientificの] a super shoulder shaking dance] [[COINCIDANCE electron-positronのwonderful Adventure} "
         }
}

3.danmuku.xml
original video: https: //www.bilibili.com/video/av80959848

<?xml version="1.0" encoding="UTF-8"?>
<i>
    <chatserver>chat.bilibili.com</chatserver>
    <chatid>138564807</chatid>
    <mission>0</mission>
    <maxlimit>1000</maxlimit>
    <state>0</state>
    <real_name>0</real_name>
    <source>k-v</source>
    <d p="15.90500,1,25,16777215,1577530864,0,43259dda,26418185093775364">前方高能</d>
</i>

Format Analysis:

  • Standard header, which contains basic information xml
  • <I> </ i> represents the first list
<?xml version="1.0" encoding="UTF-8"?>
<i></i>
    <chatserver>chat.bilibili.com</chatserver>
    <chatid>138564807</chatid>
    <mission>0</mission>
    <maxlimit>1000</maxlimit>
    <state>0</state>
    <real_name>0</real_name>
    <source>k-v</source>
    <d p= "15.90500,1,25,16777215,1577530864,0,43259dda, 26418185093775364" > front high-energy </ D >
  • chatsever: barrage library server address
  • chatid: Content connected barrage
  • maxlimit: barrage maximum number, the default is 1000
  • <d></d>:

  In < D P = "15.90500,1,25,16777215,1577530864,0,43259dda, 26418185093775364" > front high-energy </ D Example

    •   15.90500           time unit appearing barrage seconds, five after the decimal point accuracy, i.e. 0.01ms
    •   1                  barrage mode
      • 1..3 rolling barrage
      • 4 bottom barrage
      • 5 top barrage
      • 6. Reverse Barrage
      • 7 precise positioning
      • 8 Advanced barrage
    •   25                 font size,  
      • 12 is very small,
      • 16 special small,
      • 18 hours,
      • 25,
      • 36 large,
      • 45 great,
      • 64 particularly large
    •   16777215     font color to ten-digit HTML color prevail
    •   1577530864    Unix timestamp format. Reference time 1970-1-1 08:00:00
    •   0            barrage pond   
      • 0 common pool
      • 1 subtitles pool
      • [2 special pool is currently special pool for senior barrage special]
    •     43259dda       "sender block this barrage" sender ID, used for functions
    •   26418185093775364    barrage barrage in the database rowID, for "historical barrage" function.
    •     SUMMARY front energetic barrage

Fourth, the analysis to be completed full

Guess you like

Origin www.cnblogs.com/holittech/p/12210691.html