upload_btn

辅助脚本支持发布btn

当前为 2021-05-31 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/427286/936236/upload_btn.js

  1. if (GM_getValue('btn_info') !== undefined) {
  2. raw_info = JSON.parse(GM_getValue('btn_info'));
  3. raw_info = fill_raw_info(raw_info);
  4. if ($('#post').parent().parent().parent().parent().css('display') != 'none') {
  5. $('#content').find('table').first().hide();
  6. $('td.label:contains(Tech Specs)').parent().after($(`<tr><td class="label">IMDB</td>
  7. <td><input type="text" id="imdbid" name="imdbid" size="60" />
  8. <input id="fill" type="button" value="辅助填写">
  9. </td></tr>`));
  10. $('#imdbid').val(raw_info.url);
  11. $('#scenename').val(raw_info.name);
  12. $('#release_desc').val(raw_info.descr.replace(/\[.{3,15}\]/g, '').trim());
  13. setTimeout(function() {
  14. $('#fill').click(function(){
  15. var name = $('#scenename').val().trim();
  16. var title = $('#title').val().trim();
  17. if (title == name.replace(/ /g, '.')) {
  18. if (name.match(/E\d+/i) && !name.match(/S\d+E\d+/i)) {
  19. name = name.replace(/(E\d+)/, 'S01$1');
  20. $('#title').val('S01' + title.match(/E\d+/)[0])
  21. }
  22. }
  23. var tv_series = $('#artist').val();
  24. if (!tv_series.match(/(19|20)\d{2}/) && name.match(/(19|20)\d{2}[^pP]/)) {
  25. name = name.replace(/(19|20)\d{2}/, '').replace(/ +/, ' ');
  26. }
  27. try{
  28. var channels = raw_info.descr.match(/Channel.*?(\d).*?channels/)[1];
  29. var label = null;
  30. var label_str = '';
  31. if (channels == '1') {
  32. label = /1\.0/;
  33. label_str = '1.0';
  34. } else if (channels == '2') {
  35. label = /2\.0/;
  36. label_str = '2.0';
  37. } else if (channels == '6') {
  38. label = /5\.1/;
  39. label_str = '5.1';
  40. } else if (channels == '8') {
  41. label = /7\.1/;
  42. label_str = '7.1';
  43. }
  44. if (!name.match(label)) {
  45. name = name.replace(/(DDPA|AAC|DDP|FLAC|DTS|LPCM|TrueHD)/, `$1${label_str}`);
  46. }
  47. } catch(err) {alert(err)}
  48. $('#scenename').val(name.replace(/ /g, '.'));
  49. $('#origin').val('P2P');
  50.  
  51. var codec = name.codec_sel();
  52. if (codec == 'H264' || codec == 'X264') {
  53. $('#bitrate').val('H.264');
  54. } else if (codec == 'H265' || codec == 'X265') {
  55. $('#bitrate').val('H.265');
  56. }
  57. var medium = name.medium_sel();
  58. if (medium == 'HDTV') {
  59. $('#media').val('HDTV');
  60. } else if (medium == 'WEB-DL') {
  61. $('#media').val('WEB-DL');
  62. }
  63. var standard = name.standard_sel();
  64. if (standard == '720p') {
  65. $('#resolution').val('720p');
  66. } else if (standard == '1080p') {
  67. $('#resolution').val('1080p');
  68. } else if (standard == '1080i') {
  69. $('#resolution').val('1080i');
  70. } else if (standard == '4K') {
  71. $('#resolution').val('2160p');
  72. }
  73.  
  74. var mediainfo = $('#release_desc').val();
  75. if (mediainfo.match(/\.mp4/)) {
  76. $('#format').val('MP4');
  77. } else if (mediainfo.match(/\.mkv/)) {
  78. $('#format').val('MKV');
  79. }
  80. $('#international_box').attr('checked', true);
  81. var url = $('#imdbid').val();
  82. if (url.match(/tt\d+/)) {
  83. var imdb_url = 'https://www.imdb.com/title/' + url.match(/tt\d+/)[0];
  84. getDoc(imdb_url, null, function(doc) {
  85. var country = Array.from($('div.txt-block:contains("Country")', doc).find('a')).map(function(e){
  86. return $(e).text();
  87. });
  88. var country_selected = false;
  89. country.map(function(e){
  90. if ($('#country').find(`option:contains(${e.trim()})`).length) {
  91. if (!country_selected){
  92. country_selected = true;
  93. $('#country').find(`option:contains(${e.trim()})`).attr('selected', true);
  94. }
  95. }
  96. });
  97. var language = $('div.txt-block:contains("Language")', doc).find('a').text().trim();
  98. if (language == 'English') {
  99. $('#international_box').attr('checked', false);
  100. }
  101. })
  102.  
  103. }
  104. });
  105. }, 500);
  106.  
  107. $('#album_desc').css({'width': '600px', 'height': '200px'});
  108. $('#release_desc').css({'width': '600px', 'height': '500px'});
  109. } else {
  110. if (raw_info.name.match(/e\d+/i)) {
  111. $('#categories').val('Episode');
  112. } else {
  113. $('#categories').val('Season');
  114. }
  115. $('#scene_yesno').val('Yes');
  116.  
  117. $('#autofill_scene_yes').css({'display': 'block'});
  118. $('#autofill').val(raw_info.name);
  119. }
  120. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址