decode.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. package decode
  2. import (
  3. "errors"
  4. "os"
  5. "path/filepath"
  6. "regexp"
  7. "strconv"
  8. "strings"
  9. "time"
  10. "github.com/ChineseSubFinder/ChineseSubFinder/pkg/types"
  11. "github.com/ChineseSubFinder/ChineseSubFinder/pkg/types/common"
  12. "github.com/beevik/etree"
  13. PTN "github.com/middelink/go-parse-torrent-name"
  14. )
  15. func getVideoNfoInfoFromMovieXml(movieFilePath string) (types.VideoNfoInfo, error) {
  16. videoInfo := types.VideoNfoInfo{}
  17. doc := etree.NewDocument()
  18. doc.ReadSettings.Permissive = true
  19. if err := doc.ReadFromFile(movieFilePath); err != nil {
  20. return videoInfo, err
  21. }
  22. // --------------------------------------------------
  23. // IMDB
  24. for _, t := range doc.FindElements("//imdb") {
  25. videoInfo.ImdbId = t.Text()
  26. break
  27. }
  28. for _, t := range doc.FindElements("//IMDB") {
  29. videoInfo.ImdbId = t.Text()
  30. break
  31. }
  32. for _, t := range doc.FindElements("//Imdb") {
  33. videoInfo.ImdbId = t.Text()
  34. break
  35. }
  36. // --------------------------------------------------
  37. // TMDB
  38. for _, t := range doc.FindElements("//tmdb") {
  39. videoInfo.TmdbId = t.Text()
  40. break
  41. }
  42. for _, t := range doc.FindElements("//TMDB") {
  43. videoInfo.TmdbId = t.Text()
  44. break
  45. }
  46. for _, t := range doc.FindElements("//Tmdb") {
  47. videoInfo.TmdbId = t.Text()
  48. break
  49. }
  50. // --------------------------------------------------
  51. for _, t := range doc.FindElements("//ProductionYear") {
  52. videoInfo.Year = t.Text()
  53. break
  54. }
  55. //if videoInfo.ImdbId != "" {
  56. // return videoInfo, nil
  57. //}
  58. videoInfo.IsMovie = true
  59. return videoInfo, nil
  60. }
  61. func getVideoNfoInfo(nfoFilePath string, rootKey string) (types.VideoNfoInfo, error) {
  62. imdbInfo := types.VideoNfoInfo{}
  63. doc := etree.NewDocument()
  64. doc.ReadSettings.Permissive = true
  65. // 这里会遇到一个梗,下面的关键词,可能是小写、大写、首字母大写
  66. // 读取文件转换为全部的小写,然后在解析 xml ? etree 在转换为小写后,某些类型的文件的内容会崩溃···
  67. // 所以这里很傻的方式解决
  68. err := doc.ReadFromFile(nfoFilePath)
  69. if err != nil {
  70. return imdbInfo, err
  71. }
  72. for _, t := range doc.FindElements("./" + rootKey + "/title") {
  73. imdbInfo.Title = t.Text()
  74. break
  75. }
  76. //---------------------------------------------------------------------
  77. // IMDB
  78. for _, t := range doc.FindElements("./" + rootKey + "/imdbid") {
  79. imdbInfo.ImdbId = t.Text()
  80. break
  81. }
  82. for _, t := range doc.FindElements("./" + rootKey + "/imdb_id") {
  83. imdbInfo.ImdbId = t.Text()
  84. break
  85. }
  86. for _, t := range doc.FindElements("//uniqueid[@type='imdb']") {
  87. imdbInfo.ImdbId = t.Text()
  88. break
  89. }
  90. for _, t := range doc.FindElements("//uniqueid[@type='Imdb']") {
  91. imdbInfo.ImdbId = t.Text()
  92. break
  93. }
  94. for _, t := range doc.FindElements("//uniqueid[@type='IMDB']") {
  95. imdbInfo.ImdbId = t.Text()
  96. break
  97. }
  98. //---------------------------------------------------------------------
  99. // TMDB
  100. for _, t := range doc.FindElements("./" + rootKey + "/tmdbid") {
  101. imdbInfo.TmdbId = t.Text()
  102. break
  103. }
  104. for _, t := range doc.FindElements("./" + rootKey + "/tmdb_id") {
  105. imdbInfo.TmdbId = t.Text()
  106. break
  107. }
  108. for _, t := range doc.FindElements("//uniqueid[@type='tmdb']") {
  109. imdbInfo.TmdbId = t.Text()
  110. break
  111. }
  112. for _, t := range doc.FindElements("//uniqueid[@type='Tmdb']") {
  113. imdbInfo.TmdbId = t.Text()
  114. break
  115. }
  116. for _, t := range doc.FindElements("//uniqueid[@type='TMDB']") {
  117. imdbInfo.TmdbId = t.Text()
  118. break
  119. }
  120. //---------------------------------------------------------------------
  121. // TVDB
  122. for _, t := range doc.FindElements("./" + rootKey + "/tvdbid") {
  123. imdbInfo.TVdbId = t.Text()
  124. break
  125. }
  126. for _, t := range doc.FindElements("./" + rootKey + "/tvdb_id") {
  127. imdbInfo.TVdbId = t.Text()
  128. break
  129. }
  130. for _, t := range doc.FindElements("//uniqueid[@type='tvdb']") {
  131. imdbInfo.TVdbId = t.Text()
  132. break
  133. }
  134. for _, t := range doc.FindElements("//uniqueid[@type='Tvdb']") {
  135. imdbInfo.TVdbId = t.Text()
  136. break
  137. }
  138. for _, t := range doc.FindElements("//uniqueid[@type='TVDB']") {
  139. imdbInfo.TVdbId = t.Text()
  140. break
  141. }
  142. //---------------------------------------------------------------------
  143. //Season int
  144. //Episode int
  145. for _, t := range doc.FindElements("./" + rootKey + "/Season") {
  146. season, err := strconv.Atoi(t.Text())
  147. if err != nil {
  148. continue
  149. }
  150. imdbInfo.Season = season
  151. break
  152. }
  153. for _, t := range doc.FindElements("./" + rootKey + "/season") {
  154. season, err := strconv.Atoi(t.Text())
  155. if err != nil {
  156. continue
  157. }
  158. imdbInfo.Season = season
  159. break
  160. }
  161. for _, t := range doc.FindElements("./" + rootKey + "/SEASON") {
  162. season, err := strconv.Atoi(t.Text())
  163. if err != nil {
  164. continue
  165. }
  166. imdbInfo.Season = season
  167. break
  168. }
  169. for _, t := range doc.FindElements("./" + rootKey + "/Episode") {
  170. episode, err := strconv.Atoi(t.Text())
  171. if err != nil {
  172. continue
  173. }
  174. imdbInfo.Episode = episode
  175. break
  176. }
  177. for _, t := range doc.FindElements("./" + rootKey + "/episode") {
  178. episode, err := strconv.Atoi(t.Text())
  179. if err != nil {
  180. continue
  181. }
  182. imdbInfo.Episode = episode
  183. break
  184. }
  185. for _, t := range doc.FindElements("./" + rootKey + "/EPISODE") {
  186. episode, err := strconv.Atoi(t.Text())
  187. if err != nil {
  188. continue
  189. }
  190. imdbInfo.Episode = episode
  191. break
  192. }
  193. //---------------------------------------------------------------------
  194. for _, t := range doc.FindElements("./" + rootKey + "/year") {
  195. imdbInfo.Year = t.Text()
  196. break
  197. }
  198. for _, t := range doc.FindElements("./" + rootKey + "/Year") {
  199. imdbInfo.Year = t.Text()
  200. break
  201. }
  202. for _, t := range doc.FindElements("./" + rootKey + "/YEAR") {
  203. imdbInfo.Year = t.Text()
  204. break
  205. }
  206. //---------------------------------------------------------------------
  207. for _, t := range doc.FindElements("./" + rootKey + "/releasedate") {
  208. imdbInfo.ReleaseDate = t.Text()
  209. break
  210. }
  211. for _, t := range doc.FindElements("./" + rootKey + "/aired") {
  212. imdbInfo.ReleaseDate = t.Text()
  213. break
  214. }
  215. //---------------------------------------------------------------------
  216. for _, t := range doc.FindElements("./" + rootKey + "/premiered") {
  217. imdbInfo.ReleaseDate = t.Text()
  218. break
  219. }
  220. //if imdbInfo.ImdbId != "" {
  221. // return imdbInfo, nil
  222. //}
  223. return imdbInfo, nil
  224. }
  225. // GetVideoNfoInfo4Movie 从电影视频文件获取 IMDB info,只能确定拿到 IMDB ID 是靠谱的
  226. func GetVideoNfoInfo4Movie(movieFileFullPath string) (types.VideoNfoInfo, error) {
  227. videoNfoInfo := types.VideoNfoInfo{}
  228. // movie 当前的目录
  229. dirPth := filepath.Dir(movieFileFullPath)
  230. // 与 movie 文件名一致的 nfo 文件名称
  231. movieNfoFileName := filepath.Base(movieFileFullPath)
  232. movieNfoFileName = strings.ReplaceAll(movieNfoFileName, filepath.Ext(movieFileFullPath), suffixNameNfo)
  233. // movie.xml
  234. movieXmlFPath := ""
  235. // movieName.nfo 文件
  236. movieNameNfoFPath := ""
  237. // 通用的 *.nfo
  238. nfoFilePath := ""
  239. dir, err := os.ReadDir(dirPth)
  240. if err != nil {
  241. return videoNfoInfo, err
  242. }
  243. for _, fi := range dir {
  244. if fi.IsDir() == true {
  245. continue
  246. }
  247. upperName := strings.ToLower(fi.Name())
  248. if upperName == MetadataMovieXml {
  249. // 找 movie.xml
  250. movieXmlFPath = filepath.Join(dirPth, fi.Name())
  251. } else if upperName == movieNfoFileName {
  252. // movieName.nfo 文件
  253. movieNameNfoFPath = filepath.Join(dirPth, fi.Name())
  254. } else {
  255. // 找 *.nfo,很可能是 movie.nfo
  256. ok := strings.HasSuffix(fi.Name(), suffixNameNfo)
  257. if ok {
  258. nfoFilePath = filepath.Join(dirPth, fi.Name())
  259. }
  260. }
  261. }
  262. // 根据找到的开始解析
  263. if movieNameNfoFPath == "" && movieXmlFPath == "" && nfoFilePath == "" {
  264. return videoNfoInfo, common.NoMetadataFile
  265. }
  266. // 优先分析 movieName.nfo 文件
  267. if movieNameNfoFPath != "" {
  268. videoNfoInfo, err = getVideoNfoInfo(movieNameNfoFPath, "movie")
  269. if err != nil {
  270. return videoNfoInfo, err
  271. }
  272. videoNfoInfo.IsMovie = true
  273. return videoNfoInfo, nil
  274. }
  275. if nfoFilePath != "" {
  276. videoNfoInfo, err = getVideoNfoInfo(nfoFilePath, "movie")
  277. videoNfoInfo.IsMovie = true
  278. if err != nil {
  279. return videoNfoInfo, err
  280. } else {
  281. return videoNfoInfo, nil
  282. }
  283. }
  284. if movieXmlFPath != "" {
  285. videoNfoInfo, err = getVideoNfoInfoFromMovieXml(movieXmlFPath)
  286. videoNfoInfo.IsMovie = true
  287. if err != nil {
  288. } else {
  289. return videoNfoInfo, nil
  290. }
  291. }
  292. videoNfoInfo.IsMovie = true
  293. return videoNfoInfo, common.NoMetadataFile
  294. }
  295. // GetVideoNfoInfo4SeriesDir 从一个连续剧的根目录获取 IMDB info
  296. func GetVideoNfoInfo4SeriesDir(seriesDir string) (types.VideoNfoInfo, error) {
  297. imdbInfo := types.VideoNfoInfo{}
  298. dir, err := os.ReadDir(seriesDir)
  299. if err != nil {
  300. return imdbInfo, err
  301. }
  302. nfoFilePath := ""
  303. for _, fi := range dir {
  304. if fi.IsDir() == true {
  305. continue
  306. }
  307. upperName := strings.ToUpper(fi.Name())
  308. if upperName == strings.ToUpper(MetadateTVNfo) {
  309. // 连续剧的 nfo 文件
  310. nfoFilePath = filepath.Join(seriesDir, fi.Name())
  311. break
  312. } else {
  313. // 找 *.nfo
  314. ok := strings.HasSuffix(fi.Name(), suffixNameNfo)
  315. if ok {
  316. nfoFilePath = filepath.Join(seriesDir, fi.Name())
  317. }
  318. }
  319. }
  320. // 根据找到的开始解析
  321. if nfoFilePath == "" {
  322. return imdbInfo, common.NoMetadataFile
  323. }
  324. tmp, err := getVideoNfoInfo(nfoFilePath, "tvshow")
  325. tmp.IsMovie = false
  326. return tmp, err
  327. }
  328. // GetVideoNfoInfoFromEpisode 从一集获取这个 Series 的 IMDB info
  329. func GetVideoNfoInfoFromEpisode(oneEpFPath string) (types.VideoNfoInfo, error) {
  330. // 当前季的路径
  331. EPdir := filepath.Dir(oneEpFPath)
  332. // 先判断是否存在 tvshow.nfo
  333. nfoFilePath := ""
  334. dir, err := os.ReadDir(EPdir)
  335. if err != nil {
  336. return types.VideoNfoInfo{}, err
  337. }
  338. for _, fi := range dir {
  339. if fi.IsDir() == true {
  340. continue
  341. }
  342. upperName := strings.ToUpper(fi.Name())
  343. if upperName == strings.ToUpper(MetadateTVNfo) {
  344. // 连续剧的 nfo 文件
  345. nfoFilePath = filepath.Join(EPdir, fi.Name())
  346. break
  347. }
  348. }
  349. if nfoFilePath == "" {
  350. // 没有找到,那么就向上一级再次找
  351. seasonDir := filepath.Base(EPdir)
  352. seriesDir := EPdir[:len(EPdir)-len(seasonDir)]
  353. return GetVideoNfoInfo4SeriesDir(seriesDir)
  354. } else {
  355. tmp, err := getVideoNfoInfo(nfoFilePath, "tvshow")
  356. tmp.IsMovie = false
  357. return tmp, err
  358. }
  359. }
  360. // GetVideoNfoInfo4OneSeriesEpisode 获取这一集的 IMDB info,可能会因为没有获取到 IMDB ID 而返回 common.CanNotFindIMDBID 错误,但是 imdbInfo 其他信息是可用的
  361. func GetVideoNfoInfo4OneSeriesEpisode(oneEpFPath string) (types.VideoNfoInfo, error) {
  362. // 从这一集的视频文件全路径去推算对应的 nfo 文件是否存在
  363. EPdir := filepath.Dir(oneEpFPath)
  364. // 与 EP 文件名一致的 nfo 文件名称
  365. EpNfoFileName := filepath.Base(oneEpFPath)
  366. EpNfoFileName = strings.ReplaceAll(EpNfoFileName, filepath.Ext(oneEpFPath), suffixNameNfo)
  367. // 全路径
  368. EpNfoFPath := filepath.Join(EPdir, EpNfoFileName)
  369. tmp, err := getVideoNfoInfo(EpNfoFPath, "episodedetails")
  370. tmp.IsMovie = false
  371. return tmp, err
  372. }
  373. // GetSeriesDirRootFPath 从一集的绝对路径推断这个连续剧的根目录绝对路径
  374. func GetSeriesDirRootFPath(oneEpFPath string) string {
  375. oneSeasonDirFPath := filepath.Dir(oneEpFPath)
  376. oneSeriesDirFPath := filepath.Dir(oneSeasonDirFPath)
  377. if IsFile(filepath.Join(oneSeriesDirFPath, MetadateTVNfo)) == true {
  378. return oneSeriesDirFPath
  379. } else {
  380. return ""
  381. }
  382. }
  383. // GetVideoInfoFromFileName 从文件名推断文件信息,这个应该是次要方案,优先还是从 nfo 文件获取这些信息
  384. func GetVideoInfoFromFileName(fileName string) (*PTN.TorrentInfo, error) {
  385. parse, err := PTN.Parse(fileName)
  386. if err != nil {
  387. return nil, err
  388. }
  389. compile, err := regexp.Compile(regFixTitle2)
  390. if err != nil {
  391. return nil, err
  392. }
  393. match := compile.ReplaceAllString(parse.Title, "")
  394. match = strings.TrimRight(match, "")
  395. parse.Title = match
  396. return parse, nil
  397. }
  398. //GetVideoInfoFromFileFullPath 从全文件路径推断文件信息,这个应该是次要方案,优先还是从 nfo 文件获取这些信息
  399. func GetVideoInfoFromFileFullPath(videoFileFullPath string, isMovie bool) (types.VideoNfoInfo, time.Time, error) {
  400. var err error
  401. var videoNfoInfo types.VideoNfoInfo
  402. if isMovie == true {
  403. videoNfoInfo, err = GetVideoNfoInfo4Movie(videoFileFullPath)
  404. if err != nil {
  405. return types.VideoNfoInfo{}, time.Time{}, err
  406. }
  407. } else {
  408. videoNfoInfo, err = GetVideoNfoInfo4OneSeriesEpisode(videoFileFullPath)
  409. if err != nil {
  410. return types.VideoNfoInfo{}, time.Time{}, err
  411. }
  412. }
  413. /*
  414. 这里有个特殊情况,如果是某一种蓝光的文件结构,不是一个单一的视频文件
  415. * 失控玩家 (2021)
  416. * BDMV
  417. * CERTIFICATE
  418. * id.bdmv
  419. 大致是这样的目录结构,两个文件夹,下面按个文件夹中一定有这个文件 id.bdmv
  420. 那么,在前期的扫描视频的阶段,会把这样的蓝光视频给伪造一个假的不存在的视频传入进来
  421. 失控玩家 (2021).mp4 比如这个
  422. 然后需要 check 这个文件是否存在:
  423. 1. 如果 check 这个文件存在,那么就是之前的逻辑
  424. 2. 如果是这个情况肯定是不存在的,那么就要判断是否有这文件结构是否符合这种蓝光结构
  425. */
  426. if IsFile(videoFileFullPath) == true {
  427. // 常见的视频情况
  428. fInfo, err := os.Stat(videoFileFullPath)
  429. if err != nil {
  430. return types.VideoNfoInfo{}, time.Time{}, err
  431. }
  432. videoNfoInfo.IsMovie = isMovie
  433. return videoNfoInfo, fInfo.ModTime(), nil
  434. } else {
  435. // 再次判断是否是蓝光结构
  436. // 因为在前面扫描视频的时候,发现特殊的蓝光结构会伪造一个不存在的 xx.mp4 的视频文件过来,这里就需要额外检测一次
  437. bok, idBDMVFPath, _ := IsFakeBDMVWorked(videoFileFullPath)
  438. if bok == false {
  439. return types.VideoNfoInfo{}, time.Time{}, errors.New("GetVideoInfoFromFileFullPath.IsFakeBDMVWorked == false")
  440. }
  441. // 获取这个蓝光 ID BDMV 文件的时间
  442. fInfo, err := os.Stat(idBDMVFPath)
  443. if err != nil {
  444. return types.VideoNfoInfo{}, time.Time{}, err
  445. }
  446. videoNfoInfo.IsMovie = isMovie
  447. return videoNfoInfo, fInfo.ModTime(), nil
  448. }
  449. }
  450. // GetSeasonAndEpisodeFromSubFileName 从文件名推断 季 和 集 的信息 Season Episode,这个应该是次要方案,优先还是从 nfo 文件获取这些信息
  451. func GetSeasonAndEpisodeFromSubFileName(videoFileName string) (bool, int, int, error) {
  452. upperName := strings.ToUpper(videoFileName)
  453. // 先进行单个 Episode 的匹配
  454. // Killing.Eve.S02E01.Do.You.Know.How
  455. var re = regexp.MustCompile(`(?m)[\.\s]S(\d+).*?E(\d+)[\.\s]`)
  456. matched := re.FindAllStringSubmatch(upperName, -1)
  457. if matched == nil || len(matched) < 1 {
  458. // Killing.Eve.S02.Do.You.Know.How
  459. // 看看是不是季度字幕打包
  460. re = regexp.MustCompile(`(?m)[\.\s]S(\d+)[\.\s]`)
  461. matched = re.FindAllStringSubmatch(upperName, -1)
  462. if matched == nil || len(matched) < 1 {
  463. return false, 0, 0, nil
  464. }
  465. season, err := GetNumber2int(matched[0][1])
  466. if err != nil {
  467. return false, 0, 0, err
  468. }
  469. return true, season, 0, nil
  470. } else {
  471. // 一集的字幕
  472. season, err := GetNumber2int(matched[0][1])
  473. if err != nil {
  474. return false, 0, 0, err
  475. }
  476. episode, err := GetNumber2int(matched[0][2])
  477. if err != nil {
  478. return false, 0, 0, err
  479. }
  480. return false, season, episode, nil
  481. }
  482. }
  483. func GetNumber2Float(input string) (float32, error) {
  484. compile := regexp.MustCompile(regGetNumber)
  485. params := compile.FindStringSubmatch(input)
  486. if params == nil || len(params) == 0 {
  487. return 0, errors.New("get number not match")
  488. }
  489. fNum, err := strconv.ParseFloat(params[0], 32)
  490. if err != nil {
  491. return 0, errors.New("get number ParseFloat error")
  492. }
  493. return float32(fNum), nil
  494. }
  495. func GetNumber2int(input string) (int, error) {
  496. compile := regexp.MustCompile(regGetNumber)
  497. params := compile.FindStringSubmatch(input)
  498. if params == nil || len(params) == 0 {
  499. return 0, errors.New("get number not match")
  500. }
  501. fNum, err := strconv.Atoi(params[0])
  502. if err != nil {
  503. return 0, errors.New("get number ParseFloat error")
  504. }
  505. return fNum, nil
  506. }
  507. // IsFile 存在且是文件
  508. func IsFile(filePath string) bool {
  509. s, err := os.Stat(filePath)
  510. if err != nil {
  511. return false
  512. }
  513. return !s.IsDir()
  514. }
  515. // IsDir 存在且是文件夹
  516. func IsDir(path string) bool {
  517. s, err := os.Stat(path)
  518. if err != nil {
  519. return false
  520. }
  521. return s.IsDir()
  522. }
  523. // IsFakeBDMVWorked 传入的是伪造的不存在的蓝光结构的视频全路径,如果是就返回 true 和 id.bdmv 的绝对路径 和 STREAM 绝对路径
  524. func IsFakeBDMVWorked(fakseVideFPath string) (bool, string, string) {
  525. rootDir := filepath.Dir(fakseVideFPath)
  526. CERDir := filepath.Join(rootDir, "CERTIFICATE")
  527. BDMVDir := filepath.Join(rootDir, "BDMV")
  528. STREAMDir := filepath.Join(BDMVDir, "STREAM")
  529. idBDMVFPath := filepath.Join(CERDir, common.FileBDMV)
  530. if IsDir(CERDir) == true && IsDir(BDMVDir) == true && IsFile(idBDMVFPath) == true {
  531. return true, idBDMVFPath, STREAMDir
  532. }
  533. return false, "", ""
  534. }
  535. const (
  536. MetadataMovieXml = "movie.xml"
  537. suffixNameXml = ".xml"
  538. suffixNameNfo = ".nfo"
  539. MetadateTVNfo = "tvshow.nfo"
  540. // 去除特殊字符,仅仅之有中文
  541. regFixTitle = "[^\u4e00-\u9fa5a-zA-Z0-9\\s]"
  542. // 去除特殊字符,把特殊字符都写进去
  543. regFixTitle2 = "[~!@#$%^&*:()\\+\\-=|{}';'\\[\\].<>/?~!@#¥%……&*()——+|{}【】';”“’。、?]"
  544. // 获取数字
  545. regGetNumber = "(?:\\-)?\\d{1,}(?:\\.\\d{1,})?"
  546. )